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.

Angular2 How to get reference of HTML elements generated dynamically

I have this inputs generated dynamically: <div *ngFor="let cell of column; let i = index;"> <!-- Material …

angular angular2-template angular2-directives
Pass variable to custom component

I have my custom component: @Component({ selector: 'my-custom-component', templateUrl: './my-custom-component.html', styleUrls: ['./my-custom-component.css'] }) export class MyCustomComponent { constructor() { …

angular typescript angular2-template angular2-components
Angular 2: access an element from the Component, getDocumentById doesn't work

I have an Angular 2 component where I want to retrieve an element div <div id ="myId"> by its …

angular dom angular2-template angular2-components
Playing HTML 5 video from Angular 2 Typescript

I want to start playing a HTML video programmatically from TypeScript when the User clicks on the Video area itself. …

html angular angular2-template
How does ngSwitch work in Angular2?

I am trying to use ngSwitch as in this example but I get an error: My Component: template: ` <div …

angular angular2-template
How can I use ngFor to iterate over Typescript Enum as an array of strings

I am using Angular2 and Typscript. I have an enum: export enum Role { ServiceAdmin, CompanyAdmin, Foreman, AgentForeman, CrewMember, AgentCrewMember, Customer } …

angular angular2-template
How to implement ngModel on custom elements?

Given a simple input element I can do this: <input [(ngModel)]="name" /> {{ name }} This doesn't work for my …

angular angular2-template angular2-directives
How to use templateRef?

I am trying to find a way to dynamically construct a template in Angular2. I was thinking templateRef might provide …

javascript angular angular2-template
How can I pass an array as Input() from the component template?

I need to pass an array of values to a component using binding, e.g. @Component({ selector: 'my-component', template: '&…

angular angular2-template
How to detect scroll to bottom of html element

I have this element that I'm referencing by Id: let infiniteScrollElement = document.getElementById('th-infinite-scroll-tracker'); I need to listen when the …

angular angular2-template angular2-directives