摘要: import {Http,Jsonp,Headers} from "@angular/http"; private headers = new Headers({'Content-Type': 'application/json'}); this.http.post('http://localhos 阅读全文
posted @ 2018-07-17 23:51 雨夜稻草 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 1、通过 Http 同步请求: import {Http,Jsonp} from "@angular/http"; constructor(private http:Http,private jsonp:Jsonp) { } this.http.get("http://www.phonegap100 阅读全文
posted @ 2018-07-17 23:40 雨夜稻草 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1 、*ngFor 普通循环,并获取索引 <ul> <li *ngFor="let item of list;let i = index;"> {{item}} </li></ul> 2 、 template 循环数据 <ul> <li template="ngFor let item of lis 阅读全文
posted @ 2018-07-17 22:34 雨夜稻草 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 1、 数据文本绑定{{title}} 2、绑定 html this.h="<h2>这是一个 h2 用[innerHTML]来解析</h2>" <div [innerHTML]="h"></div> 3、绑定属性 <div [id]="id" [title]="msg">调试工具看看我的属性</div 阅读全文
posted @ 2018-07-17 22:27 雨夜稻草 阅读(109) 评论(0) 推荐(0) 编辑