17.0.3 • Published 9 months ago
@nahuelmorata/ngx-command v17.0.3
NgxCommand
Implementacion del patron de Command para angular. El uso principal es para la deshabilitacion del boton mientras se ejecuta
Contacto
Versiones
Version | Angular Version |
---|---|
v1.x.x | v9.x.x |
v2.x.x | v10.x.x |
v3.x.x | v11.x.x |
v4.x.x | v12.x.x |
v5.x.x | v13.x.x |
v6.x.x | v14.x.x |
v7.x.x | v15.x.x |
v8.x.x | v16.x.x |
Instalacion
Con npm
npm i @nahuelmorata/ngx-command
Con yarn
yarn add @nahuelmorata/ngx-command
Uso
Agregar modulo
import { NgxCommandModule } from '@nahuelmorata/ngx-command';
@NgModule({
imports: [
NgxCommandModule
]
})
export class AppModule {}
En el componente
import { ICommand, CommandAsync } from '@nahuelmorata/ngx-command';
@Component({})
export class AppComponent {
public accionCmd: ICommand = new CommandAsync(() => this.accion());
private async accion() {
}
}
En el template
<button [command]="accionCmd">Accion</button>
Con parametros
En el componente
import { ICommand, CommandAsync } from '@nahuelmorata/ngx-command';
@Component({})
export class AppComponent {
public accionCmd: ICommand = new CommandAsync((parametro: string) => this.accion(parametro));
private async accion(parametro: string) {
console.log(parametro); // 'texto'
}
}
En el template con un solo parametro
<button [command]="accionCmd" commandArg="texto">Accion</button>
O
En el template con varios parametros
<button [command]="accionCmd" [commandArgs]="['texto', 'otro']">Accion</button>
18.0.0
9 months ago
6.0.1
12 months ago
6.0.3
12 months ago
6.0.2
12 months ago
6.0.4
12 months ago
8.1.4
12 months ago
8.1.3
12 months ago
17.0.3
12 months ago
17.0.2
12 months ago
8.1.2
12 months ago
8.1.1
1 year ago
17.0.1
1 year ago
17.0.0
1 year ago
7.1.0
1 year ago
8.1.0
1 year ago
7.0.2
2 years ago
7.0.1
2 years ago
8.0.1
2 years ago
8.0.2
2 years ago
8.0.0
2 years ago
7.0.0
2 years ago
6.0.0
3 years ago
5.1.1
3 years ago
4.0.2
3 years ago
5.1.0
3 years ago
5.0.0
3 years ago
3.0.7
3 years ago
4.0.1
3 years ago
4.0.0
4 years ago
3.0.6
4 years ago
1.0.6
4 years ago
2.0.6
4 years ago
2.0.5
4 years ago
3.0.5
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago