angular的自定义属性1.[name]="name"与属性绑定类似。2.(click)="goNav()" 绑定事件,使用括号()3.自定义事件用()总结就是:事件用(),属性用[ ]4.路由。router, [path:"",component:""]
1.ng generate service data --module=app
2.import{Http} from '@angular/http';
import 'rxjs/add/operator/map';
construct(private http:Http){}
return this.http.get("url").map((res)=>res.json);
this.dataService.fetchData.subscribe(data=>this.people=data);
网友评论