ng-autofocus-directive
v0.0.3
Published
This directive solves the issue of autofocus in angular 2.x, inclusive when you use a dinamically input created before the DOM generation, for example an input created using *ngIf or a hidden input.
Downloads
93
Readme
ng-autofocus-directive
This directive solves the issue of autofocus in angular 2.x, inclusive when you use a dinamically input created before the DOM generation, for example an input created using *ngIf or a hidden input.
Install
You can get it on npm:
npm install ng-autofocus-directive --save
Setup
You'll need to add AutofocusModule
to your application module.
import { AutofocusModule } from 'ng-autofocus-directive';
@NgModule({
imports: [
AutofocusModule
],
declarations: [
AppComponent
],
providers: [],
bootstrap: [AppComponent]
export class AppModule {}
})
Usage
Use the directive in your input:
<input ngAutoFocus type="text">