1 2 3 4

PomeloYe

博客园 首页 新随笔 联系 订阅 管理
  • https://stackblitz.com/ 借助StackBlitz网站可快速开始搭建一个angular项目
  • 一个angular的component包含三项东西
    • A component class that handles data and functionality. (componentName.component.ts)
    • An HTML template that determines the UI. (componentName.component.html)
    • Component-specific styles that define the look and feel. Though product list does not define any styles, this is where component CSS resides.(componentName.component.spec.ts)
  • Angular's template syntax extends HTML and JavaScript. 

    five common features of Angular's template syntax:

    • <div *ngFor = "let product of products">the <div></div> repeats for each product in the products list.
    • <p *ngIf="product.description"></p>

      Angular only creates the <p> element if the current product has a description

    • Interpolation {{ }}
    • Property binding [ ]
    • Event binding ( )
  • ts既typescript
  • 项目编译用得是TypeScript编译器,当代码变化时,它会自动重新编译。 同时,该命令还会在浏览器中启动该应用,并且当代码变化时刷新浏览器。

       

       

参考 <https://angular.io/start#getting-started-with-angular-your-first-app>

   

   

posted on 2019-11-04 17:35  PomeloYe  阅读(207)  评论(0编辑  收藏  举报