Tag:angular2

  • Angular 4.x Router Link Directives

    Time:2020-1-21

    Routerlink instruction introduction The routerlink directive allows you to link to specific parts of the application. If the link is static, we can use the instruction as follows: <a routerLink=”/user/bob”>link to user component</a> If you need to generate a link address using dynamic values, you can pass an array of path segments, and then parameters […]

  • Quick start to angular 4. X routing

    Time:2020-1-17

    A group of interested friends can add QQ group: angular Xiuxian Road (1) group – 153742079 (full), please add angular Xiuxian Road (2) group – 648681235. Routing is the core of an angular application. It loads the components associated with the requested route and obtains the relevant data of a specific route. This allows us […]

  • Angular 4.x Injector

    Time:2020-1-16

    Before introducing the angular injector, we need to understand the concept of dependency injection. In software engineering, dependency injection is an implementation of inversion of control to solve the dependency design pattern. A dependency refers to an object that can be used (that is, the service provider). Dependency injection is to pass the dependent to […]

  • Angular 2. X structure instruction

    Time:2020-1-14

    What is structure instruction? The structure directive changes the DOM layout by adding and removing DOM elements. Two common structural instructions in angular are*ngIfand*ngFor。 understand*Number grammar *The number is a syntactic sugar used to avoid complex syntax. We take*ngIfFor example: (picture source: https://netbasal.com/) Angular wraps the host element in thetemplateInside the label Angular willngIfConvert to […]

  • Scope related problems of angular ngmodule

    Time:2020-1-8

    Ngmodule is the first basic structure you encounter when you write an application using angular, but it is also the most subtle and complex because it involves different scopes. If you want to know more about ngmodule, you can directly refer to the ngmodule section of the Angualr ngmodule FAQ or the angular FAQ article. […]

  • Example of angular2 / 4 tree structure menu

    Time:2020-1-7

    Tree structure assembly import { Component, Input } from ‘@angular/core’; @Component({ selector: ‘app-tree’, templateUrl: ‘./tree.component.html’, styleUrls: [‘./tree.component.scss’] }) export class TreeComponent { //Super simple, focus: receive superior value //You can establish an interface for the tree, which is simplified as any @Input() treelists: any //Click action itemClick(i) { //Set up a service to receive the […]

  • Angular 4.x NgIf

    Time:2020-1-6

    Function of ngif command ngIfDirective to render at a specified location based on the value of the expressionthenorelseContent of the template. The default value of the then template is unless it is bound to a different valuengIfThe inline template associated with the directive. Else template is null by default unless the corresponding value is bound. […]

  • Angular 4.x NgTemplateOutlet

    Time:2020-1-4

    Ngtemplateoutlet instruction function This instruction is used toTemplateRefObject to insert the corresponding embedded view. When applying the ngtemplateoutlet instruction, we can use the[ngTemplateOutletContext]Property to setEmbeddedViewRefContext object for. The context of the binding should be an object. In addition, theletSyntax to declare the binding context object property name. Friendly tip: if the let syntax is not […]

  • Angular 4.x NgForOf

    Time:2020-1-3

    Ngforof instruction function This instruction is used to create a template based on each item in the iteratable object. The context object of each instantiated template inherits from the external context object, and its value is associated with the value of the corresponding item of the iteratable object. Ngforof instruction syntax *Grammatical sugar <li *ngFor=”let […]

  • Angular dynamic load component

    Time:2019-12-31

    Introduction Sometimes you need to render different components according to the URL. I mean to display different components in the same URL address according to the changes of parameters. This is done by using the angular dynamic loading component, and at the same time, we will try to make this part of dynamic components also […]

  • Introduction to dependency injection, one of the tutorials of angular 4 dependency injection

    Time:2019-12-30

    Catalog Introduction to dependency injection, one of the tutorials of angular 4 dependency injection Angular 4 dependency injection tutorial 2 component service injection The third tutorial of angular 4 dependency injection: the use of classprovider Angular 4 dependency injection Tutorial 4 use of factoryprovider Angular 4 dependency injection tutorial 5 factoryprovider configuration dependency object The […]

  • Angular 4 dependency injection tutorial 2 component service injection

    Time:2019-12-29

    Catalog Introduction to dependency injection, one of the tutorials of angular 4 dependency injection Angular 4 dependency injection tutorial 2 component service injection The third tutorial of angular 4 dependency injection: the use of classprovider Angular 4 dependency injection Tutorial 4 use of factoryprovider Angular 4 dependency injection tutorial 5 factoryprovider configuration dependency object The […]