• Angular 4.x Router Link Directives


    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 […]

  • angular ajax loading


    Knowledge points:Using interceptors to handle HTTP errors in angularjs Specific implementation:/** Interceptor global $HTTP injection loading effect*/ define([‘jquery’,’angular’], function($,angular){ angular.module(‘ajaxLoading’, []) .config(function($httpProvider) { $httpProvider.interceptors.push(‘loadingInterceptor’); }) .directive(‘loading’, function() { return { replace: true, restrict: ‘AE’, template:'<div class=”back-layer”><div class=”loading”>’ +'<img>’ +'</div></div>’, link: function($scope, $element, attrs) { var top = $(window).height()/2 – 25; var left = $(window).width()/2 – […]

  • 11 great angularjs tools


    Angularjs tools are very helpful for you to develop angularjs app projects. The following tools are especially suitable for creating single page web applications. Today, we share 11 angularjs tools that are very helpful to web developers. If you have other great tools, please leave a message in the comments to let us know. 1. […]

  • Verification of angular based on ng messages


    html <div class=”form-group” ng-class=”{‘has-error’: myForm.myName.$touched && myForm.myName.$invalid}”> <label class=”col-xs-2 control-label”>name</label> <div class=”col-xs-6″> <input type=”text” class=”form-control” name=”myName” ng-model=”formData.username” Placeholder = “2-10 Chinese and English characters, AAA will have the same name, required” name-check minlength=”2″ maxlength=”10″ required> </div> <div class=”col-xs-4 form-control-static text-danger” ng-messages=”myForm.myName.$error” ng-messages-include=”demos/form/error.html” ng-show=”myForm.myName.$touched”> </div> </div> Ng messages = “myform. Myname. $error” gives the error type […]

  • Angular 4.x Injector


    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 directive&&Vue component


    Small share, add experience, big god please ignore.Directive is also a component, which containsscopeIn fact, it is used to communicate between parent and child components. The same Vue component is also used for components, and the communication method in it uses another nounprops:It’s the same in essence. Here I post the code for you to […]

  • Angular 2. X structure instruction


    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 […]

  • [translate] the difference between ng if and ng show and the problem that ng if will create sub scopes


    Last week, there was a demand for better filtering of data. Two floating boxes need to be set The content displayed after clicking is each team and each type of work. At the beginning, I thought it was to use two floating boxes. I found them for a long time, but I didn’t find them. […]

  • Page Jump passing parameters at the same time in angular


    When I encounter a page Jump, I want to get the data of the page before the jump from the page after the jump. I want to use a local storage, a broadcast and on. Then the boss said it’s not so troublesome. Since both $state.go have parameters directly, this time I’ll introduce the parameters […]

  • Detailed explanation of angularjs filter


    The function of filter is to receive an input, process it through a rule, and then return the processed result to the user. Angularjs has 9 kinds of built-in filters, which can also be customized by developers. 1、 Angularjs 9 built-in filters 1. Filter: select a subset of the array and return a new array(selections […]

  • The usage of NG repeat start and ng repeat end in angular


    Ng repeat start and ng repeat end are extensions of angular (1.2. X) for flexible control traversal Part index: <div class=”item item-input-inset” **ng-repeat-start**=”item in accessoryImg”> < span class = “input label” ng bind = “I18N. Accessory [label” > < / span > <! — Attachment — > <button class=”button button-outline button-calm button-center” ng-bind=”i18n.upload_accessory_btn” Ng Click […]

  • Angular replication plug-in ngclipboard


    1, installation npm install ngclipboard –save 2. Introduce dependency var myApp = angular.module(‘app’, [‘ngclipboard’]); 3, use 1. But use ID to load the content in the tag data-clipboard-target=”#foo” 2. Values can also be obtained data-clipboard-text=”” Case study: 1. <!– Target –> <input id=”foo” value=”https://github.com/sachinchoolur/ngclipboard.git”> <!– Trigger –> <button class=”btn” ngclipboard data-clipboard-target=”#foo”> <img> </button> 2. <input […]