1.0.0 • Published 7 years ago
angular-secret-click v1.0.0
Angular Secret Click
Trigger an event after being clicked N number of times. It's similar to how you enabling developer options on Android (https://developer.android.com/studio/debug/dev-options).
Installation
npm install angular-secret-click --save
Once installed, you need to import the module and list the imported module in your application module:
import { SecretClickModule } from 'angular-secret-click';
@NgModule({
declarations: [
AppComponent,
...
],
imports: [
SecretClickModule,
...
],
bootstrap: [AppComponent]
})
export class AppModule { }
Usage
Add the jlSecretClick
directive to your element and any events you need to listen to.
<button
type="button"
jlSecretClick
(jlSecretProgress)="onProgress($event)"
(jlSecretReset)="onReset()"
(jlSecretComplete)="onComplete()">
Click me to reveal secrets!
</button>
Inputs
jlSecretClick
accepts an optional object with the following properties:
Name | Description | Type | Default |
---|---|---|---|
target | Number of clicks before complete is triggered. | number | 7 |
threshold | Number of milliseconds until reset is trigger. | number | 1000 |
Outputs
Name | Description | Data |
---|---|---|
jlSecretProgress | Emitted on any click event, until the target is reached. | number |
jlSecretReset | Emitted on reset, after the threshold has been hit. | n/a |
jlSecretComplete | Emitted when the target has been reached. | n/a |
1.0.0
7 years ago