# ngx-focus

> Simple focus directive to be used with Angular, useful when you showing and hiding filed multiple times with *ngIf

Latest version **1.0.3** (published 2019-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-focus
pnpm add ngx-focus
yarn add ngx-focus
bun add ngx-focus
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-08-07 |
| First published | 2019-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 33.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Miloš Brdar |
| Maintainers | mbrdar |
| Keywords | angular, javascript, focus, directive |

## Links

- npm: https://www.npmjs.com/package/ngx-focus
- Repository: https://github.com/mbrdar/ngx-focus
- Homepage: https://github.com/mbrdar/ngx-focus#readme
- Issues: https://github.com/mbrdar/ngx-focus/issues
- npm.io page: https://npm.io/package/ngx-focus

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 1.0.3 (latest) — 2019-08-07
- 1.0.2 — 2019-08-07
- 1.0.1 — 2019-08-07
- 1.0.0 — 2019-08-07

## README

<h1 align="center">ngx-focus</h1>



<p align="center">



Focus directive.



##  Getting Started



ngx-focus contains a angular directive. Directive can be applied to a DOM element in order to focus it conditionally.
Very useful when you are using field in combination with *ngIf.


##  Installation instructions

Install `ngx-focus` from `npm`:

```bash

npm install ngx-focus --save

```



Add `NgxFocusModule` to NgModule imports:

```

import { NgxFocusModule } from 'ngx-focus';



@NgModule({

...

imports: [NgxFocusModule,...]

...

})

```
Add directive to your page:
```

<input ngxFocus>


```
with condition:
```

<input [ngxFocus]="condition">

```

### Inputs
`ngxFocus` Indicates that element should be focused or not, default is `true`

### Outputs
`fieldFocused`
Emits event when field is focused.

---
_Source: https://npm.io/package/ngx-focus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
