https://github.com/spirosikmd/angular2-focus
Angular attribute directive that gives focus on an element depending on a given expression 🔎
https://github.com/spirosikmd/angular2-focus
angular angular2 directive focus
Last synced: 6 months ago
JSON representation
Angular attribute directive that gives focus on an element depending on a given expression 🔎
- Host: GitHub
- URL: https://github.com/spirosikmd/angular2-focus
- Owner: spirosikmd
- License: mit
- Created: 2016-10-19T18:00:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T15:40:09.000Z (over 2 years ago)
- Last Synced: 2024-11-11T13:40:45.760Z (6 months ago)
- Topics: angular, angular2, directive, focus
- Language: JavaScript
- Homepage:
- Size: 5.06 MB
- Stars: 21
- Watchers: 2
- Forks: 3
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# angular2-focus
Angular attribute directive that gives focus on an element depending on a given expression.
[![Build Status][build-badge]][build]
[![version][version-badge]][package]
[![PRs Welcome][prs-badge]](http://makeapullrequest.com)
[![All Contributors][all-contributors-badge]](#contributors)
[![Greenkeeper badge][greenkeeper-badge]](https://greenkeeper.io/)## Install
`npm install --save angular2-focus`
## Example
```typescript
import {NgModule, Component} from '@angular/core';
import {FocusModule} from 'angular2-focus';@Component({
template: `
`
})
class AppComponent { }@NgModule({
imports: [FocusModule.forRoot()],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
```Check the [docs](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](https://github.com/kentcdodds/all-contributors#emoji-key)):
| [
Spyros Ioakeimidis](http://www.spyros.io)
💬 [💻](https://github.com/spirosikmd/angular2-focus/commits?author=spirosikmd) [⚠️](https://github.com/spirosikmd/angular2-focus/commits?author=spirosikmd) |
| :---: |This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification.
Contributions of any kind welcome![version-badge]: https://img.shields.io/npm/v/angular2-focus.svg?style=flat-square
[package]: https://www.npmjs.com/package/angular2-focus
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[build-badge]: https://img.shields.io/travis/spirosikmd/angular2-focus.svg?style=flat-square
[build]: https://travis-ci.org/spirosikmd/angular2-focus.svg
[all-contributors-badge]: https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square
[greenkeeper-badge]: https://badges.greenkeeper.io/spirosikmd/angular2-focus.svg