Basically I'm looking for a way to implement a counterpart to Angular 1.x ngInit directive.  I'm aware of ngOnInit hook and the fact that it is the recommended place for initialization code. I consider ngInit directive a quick, declarative  w...
I am trying to find a way to dynamically construct a template in Angular2. I was thinking templateRef might provide a way to do this. But I could be wrong.  I found an example of templateRef being used here.  I was looking at templateRef in this exam...
We are working on a decoupled project with Drupal as our backend and Angular as our front-end. Everything is nearing completion but certain (dynamic, as in created in Drupal) pages require links to different pages of the angular app.  For example:...
i'm trying to access the html elements inside the tabs component using the example from angular 2 docs: https://angular.io/resources/live-examples/homepage-tabs/ts/plnkr.html Here is my implementation so far:        import {Component, ElementRef,...
I have a component to which I am passing a template. Inside of this component I would like to pass context so that I could display data.  @Component({   selector: 'my-component',   providers: [],   template: `     <template [ngTemplateOutl...
I am using Angular 4 and have installed Angular Material 2 as I like how the components look.  So now I have all the components and want to create a layout.  I know there's Angular Flex-layout for it but to be honest I don't know Flex that we...
I read that we can interpolate Javascript expressions. What is the list of valid Javascript expressions that we can interpolate? So far for interpolation I have a displayed property, eg. object.property, short expressions like {{1+1}} what else Javas...
From reading several Angular resources (see below), calling methods in templates can cause performance issues. E.g.  <div>{{getDisplayName()}}</div>   However, quite a few of the Angular Material library examples call methods in the templ...
I'm still trying to learn ng2 so I'm sure this is a common noob problem but none of the solutions I found online helped. anyone know what my problem is?  I have a service with the getEventList() method as an observable  getEventList(): Observ...
I need to inject instances of a custom html-component dynamically, and it would be really useful to be able to "$digest" a template on the fly. How can I do this in angular2? Right now I have this:  let html = `<custom-element>Content&l...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.