Just like in *ngFor, you're able to pass in data into your own structural directives. This is done by declaring the variable using a let statement then passing context into the createEmbeddedView call. We know *ngFor we did like this: *ngFor="let mes…
Structural directives enable you to use an element as a template for creating additional elements. Creating structural directives requires a knowledge of <template> elements, but they're easy and extremely powerful once you undrestand the concepts.…
For example we have two buttons: When we click nether one of those tow button, the modal should show up: We will use structure directive to do that. So create a new directive 'auModalOpenOnClick': import {Directive, TemplateRef, ViewContainerRef} fro…
Just like passing in an array to *ngFor, you can pass in any value into your structural directive so that it can render templates based on those values. It's crucial to understand how the *directive syntax expands into a <template> and adds a custo…
---------------------------Scope-------------------------------- https://docs.angularjs.org/guide/scope What are Scopes? Scope is an object(是一个数据模型) that refers to the application model. It is an execution context(scope是表达式的执行上下文) for expressions. Sc…
原文: https://stackoverflow.com/questions/11616636/how-to-do-two-way-filtering-in-angularjs ------------------------------------------------------------------------------------------------------------ It turns out that there's a very elegant solution t…