Skip to content

DanielKucal/angular-clickable-click

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clickable (click) for Angular 2+

Angular 2+ Directive adding pointer cursor for elements using (click) directive. Respects [disabled] input.

Installation

  1. Get it from npm i angular-clickable-click --save
  2. Import ClickableClickModule
    import { ClickableClickModule } from 'angular-clickable-click';
    
    @NgModule({
      // ...
      imports: [ClickableClickModule],
      // ...
    })
    class AppModule {}
@Component({
  selector: 'app',
  template: `
    <div (click)="isDisabled = true" [disabled]="isDisabled">
    I am <b *ngIf="isDisabled">no longer</b> clickable
    </div>
  `
})
export class AppComponent {
  public isDisabled: boolean = false;
}

About

Adds cursor: pointer styling to elements having (click) directive, prevents event when disabled.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published