17.0.0 • Published 24 days ago

@nahuelmorata/ngx-command v17.0.0

Weekly downloads
8
License
-
Repository
-
Last release
24 days ago

NgxCommand

Implementacion del patron de Command para angular. El uso principal es para la deshabilitacion del boton mientras se ejecuta

Contacto

Contactame

Versiones

VersionAngular Version
v1.x.xv9.x.x
v2.x.xv10.x.x
v3.x.xv11.x.x
v4.x.xv12.x.x
v5.x.xv13.x.x
v6.x.xv14.x.x
v7.x.xv15.x.x
v8.x.xv16.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>
17.0.0

24 days ago

7.1.0

2 months ago

8.1.0

2 months ago

7.0.2

5 months ago

7.0.1

5 months ago

8.0.1

5 months ago

8.0.2

5 months ago

8.0.0

6 months ago

7.0.0

12 months ago

6.0.0

2 years ago

5.1.1

2 years ago

4.0.2

2 years ago

5.1.0

2 years ago

5.0.0

2 years ago

3.0.7

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.0.6

3 years ago

1.0.6

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

3.0.5

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago