Disable Button in Angular 2
Change ng-disabled=”!contractTypeValid” to [disabled]=”!contractTypeValid”
Change ng-disabled=”!contractTypeValid” to [disabled]=”!contractTypeValid”
Basically there are three types of directives in Angular2 according to documentation. Component Structural directives Attribute directives Component It is also a type of directive with template,styles and logic part which is most famous type of directive among all in Angular2. In this type of directive you can use other directives whether it is custom … Read more
After some research and modifying my code as below, the script worked for me. I just added the condition: this.router.navigateByUrl(‘/RefreshComponent’, { skipLocationChange: true }).then(() => { this.router.navigate([‘Your actualComponent’]); });
Yes. Try: class USBDevice : GenericDevice, IOurDevice Note: The base class should come before the list of interface names. Of course, you’ll still need to implement all the members that the interfaces define. However, if the base class contains a member that matches an interface member, the base class member can work as the implementation … Read more
Run change detection explicitly after the change: import { ChangeDetectorRef } from ‘@angular/core’; constructor(private cdRef:ChangeDetectorRef) {} ngAfterViewChecked() { console.log( “! changement de la date du composant !” ); this.dateNow = new Date(); this.cdRef.detectChanges(); }
Updated: 19/03/2017 this.form.controls[‘dept’].setValue(selected.id); OLD: For now we are forced to do a type cast: (<Control>this.form.controls[‘dept’]).updateValue(selected.id) Not very elegant I agree. Hope this gets improved in future versions.
It should be noted that it is an anti-pattern to copy properties that never change to the state (just access .props directly in that case). If you have a state variable that will change eventually but starts with a value from .props, you don’t even need a constructor call – these local variables are initialized … Read more
Components control views (html). They also communicate with other components and services to bring functionality to your app. Modules consist of one or more components. They do not control any html. Your modules declare which components can be used by components belonging to other modules, which classes will be injected by the dependency injector and … Read more
what benefits does OSGi’s component system provide you? Well, Here is quite a list: Reduced Complexity – Developing with OSGi technology means developing bundles: the OSGi components. Bundles are modules. They hide their internals from other bundles and communicate through well defined services. Hiding internals means more freedom to change later. This not only reduces … Read more