When we pass value to a component, normally we use @Input. <my-comp [courses]="(courses$ | async) as courses" ></my-comp> @Component({...}) export class MyComp implements OnInit { @Input() courses; ... } Angular will check whether an…
这几天,根据buddy指定的任务,要分享一点angular JS的东西.对于一个在前端属于纯新手的我来说,Javascript都还是一知半解,要想直接上手angular JS,遇到的阻力还真是不少.不过我相信,只要下功夫,即使是反人类的设计也不是什么大的问题. Okay,废话不多说.为了弄明白angular JS为何物,我先是从Scope开始.那么什么是Scope呢?借用官方文档的一段话: “scope is an object that refers to the applicatio…