angular2-focus
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

angular2-focus

Angular attribute directive that gives focus on an element depending on a given expression.

Build Status version PRs Welcome All Contributors Greenkeeper badge

Install

npm install --save angular2-focus

Example

import {NgModule, Component} from '@angular/core';
import {FocusModule} from 'angular2-focus';
 
@Component({
  template: `
    <input type="text" focus="true">
  `
})
class AppComponent { }
 
@NgModule({
  imports: [FocusModule.forRoot()],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule { }

Check the docs for examples using @angular/forms and other third party libraries such as @ng-bootstrap/ng-bootstrap, to focus elements when e.g. using a modal.

Contributors

Thanks goes to these wonderful people (emoji key):


Spyros Ioakeimidis

💬 💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.4311latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.4311
1.1.30
1.1.20
1.1.11
1.1.04
1.0.40
1.0.30
1.0.20
1.0.10
1.0.03

Package Sidebar

Install

npm i angular2-focus

Weekly Downloads

319

Version

1.1.4

License

MIT

Unpacked Size

337 kB

Total Files

46

Last publish

Collaborators

  • spyros.io