ng-autofocus-directive
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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.

Build Status Dependency Status devDependency Status npm

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">

Readme

Keywords

none

Package Sidebar

Install

npm i ng-autofocus-directive

Weekly Downloads

23

Version

0.0.3

License

MIT

Last publish

Collaborators

  • bennyfranco