Angular questions
Angular questions
fontSize = "20";
document.getElementById("myText").className = "anyclass";
The pop() method is similar as the shift() method but the difference is that
the Shift method works at the start of the array
var I = new object();
JavaScript:
TypeScript:
Templates: Templates are written in HTML and contain Angular elements and
attributes. Models provide a dynamic view to the user by combining information
from the controller and view and rendering it.
Directives: Directives allow developers to add new HTML syntax, that is
application-specific. The behavior is essentially added to the existing DOM
elements.
Services: Rather than calling the Http service, Angular allows for the creation of
new service classes. When new Services are created in Angular, they can be used
by different components.
AngularJS Angular
Based on JavaScript Based on TypeScript
Based on the MVC design pattern Based on components, modules, and
directives
Structural Directive
Structural directives change the structure of DOM. Examples, *ngIf and *ngFor.
Usage example.
<div *ngIf = “product” class=”name”>{{product.name}}</div>
Same way.
<ul> <li *ngFor = “Show product list”>{{product.name}}</li> </ul>