Top "Angular2-template" questions

For questions referencing Angular Template Syntax including: interpolation, input(property) bindings, output(event) bindings, two-way binding, local variables, star syntax, etc.

Differences of using Component template vs templateUrl

Angular 2 allows to write multi-line templates by using ` characters to enquote them. It is also possible to put multi-line template …

angular angular2-template
How can I integrate Google Maps APIs inside an Angular 2 component

I have an Angular 2 component that is defined in the file comp.ts in this way like this: import {Component} …

google-maps angular angular2-template
HTML check variable undefined with ngIf excluding case when value is 0

I am using Angular 2 and would like to check if a variable value is undefined using the htm *ngIf condition. …

angular angular2-template angular2-directives
Get file name from input type file Angular2

I want get the file name from my html input tag in a modal view and save it using Angular2. …

html angular angular2-template html-input
Set null as empty string value for input field

I have an input field mapped to an entity in my controller with a ngModel 2-way binding: <input type="…

angular angular2-template
Angular 2 Change Class On Condition

I have three buttons in a view and on page load I am displaying the first buttons content. Once a …

javascript angular typescript angular2-template angular2-directives
how to append HTML content in angular 2 using innerHTML

I use innerHTML to render HTML Content in my component. But innerHTML remove all the attributes (eg: removes style attributes) …

angular angular2-template innerhtml
Angular2 ngSwitch with <template> only

I would like to use ngSwitch to conditionally render some content, but I want that content to be the only …

angular angular2-template
angular 5: templateRef.createEmbeddedView is not a function

Here's the code I'm trying to get to work (angular 5): import { Component, ViewChild, TemplateRef, ViewContainerRef } from '@angular/core'; @Component({ …

angular angular2-template
Using comma as a list separator in Angular 2

I want to create a list of items in my template, separated by commas, but I don't want the last …

angular angular2-template