[Angular] Angular Elements Intro】的更多相关文章

Make sure install the latest Angular v6 with Angular CLI. Checkout ght Github for the code. 1. Create a new application: ng new elementApp 2. Install @angular/elements package: ng add @angular/elements --project-name=<your_project_name> 3. Generate…
First, What is directive, what is the difference between component and directive. For my understanding, component is something like 'canvas', 'form', 'table'... they have the template and their own functionality. It defines how a html tag should work…
1. Installl latest @angular/cli: sudo npm i -g @angular/cli@next The version I used is:6.0.0-rc.10 2. Create a new application: ng new cdk-demo --routing 3. Install material and cdk packages: Here need to add @next, because by the time I tried the ap…
You have complete control over the elements you nest inside of your component instance by using selectors to access and rearrange them. Selecting allows you reconstruct the elements in whatever order you like so you can visual customize the content p…
To use http, we need to import the HTTP_PROVIDER, so that we can inject http to other component: import {HTTP_PROVIDERS} from 'angular2/http'; bootstrap(App, [ HTTP_PROVIDERS ]); simple-request.ts: import {Component} from 'angular2/core'; import {Htt…
angular.Module Angular模块配置接口. 方法: provider(name,providerType); name:服务名称. providerType:创建一个服务的实例的构造函数. factory(name,providerFunction); name:服务名称. providerFunction:创建服务的实例的函数. service(name,constructor); name:服务名称. constructor:一个将被实例化的构造函数. value(name,…
angular.injector 创建一个injector对象, 调用injector对象的方法可用于获取服务以及依赖注入. 格式:angular.injector(modules); modules:  Array 注入的模块(一个或多个). 使用代码: (function () { angular.module("firstModule", []) .service("firstService", function () { this._log = functi…
angular.isArray 判断括号内的值是否为数组. 格式:angular.isArray(value); value: 被判断是否为数组的值. --------------------------------------------------------------- angular.isDate 判断括号内的值是否是一个时间. 格式:angular.isDate(value); value:被判断是否为时间的值. -----------------------------------…
angular.uppercase 将指定的字符串转换成大写 格式:angular.uppercase(string); string:被转换成大写的字符串. 使用代码: var str = "ABCabc"; var upperCase = angular.uppercase(str);//ABCABC angular.lowercase 将指定的字符串转换成小写 格式:angular.lowercase(string); string:被转换成小写的字符串. 使用代码: var s…
angular.bind 返回一个调用self的函数fn(self代表fn里的this).可以给fn提供参数args(*).这个功能也被称为局部操作,以区别功能. 格式:angular.bind(self,fn,args); self:object  对象: fn的上下文对象,在fn中可以用this调用 fn:function: 绑定的方法 args:传入fn的参数 使用代码: var obj = { name: "Any" }; var fn = function (Adj) { c…