随笔分类 -  angular学习

摘要:ts import { Component } from '@angular/core'; // 定义一个interface interface Menu{ title:string,link:string,id:string } @Component({ selector: 'app-root', 阅读全文

posted @ 2020-12-28 03:20 猫头唔食鱼 阅读(370) 评论(0) 推荐(0) 编辑

摘要:很久没学ng,忽然想学。 发现ng已经和之前有很大不同了。 之前我学的是angular.js 现在是直接学angular ??? 我记得以前用的for循环指令是 ng-for 现在是 *ngFor 好吧。就吐槽到这。 开始内容 1.准备循环的数组 2.ul 和li 结构 渲染结果: 阅读全文

posted @ 2020-12-22 02:19 猫头唔食鱼 阅读(108) 评论(0) 推荐(0) 编辑

摘要:angular定义数据,直接变量 ,例如,test = '"xxx" 页面使用数据{{test}} 严谨一点的写法ts public test:string = "test"; public 公共 protect 可以在当前类和子类下使用 private 可以在当前类下使用 阅读全文

posted @ 2019-11-05 01:06 猫头唔食鱼 阅读(538) 评论(0) 推荐(0) 编辑

摘要:angular创建组件,需要通过命令。 输入命令后重新运行。在app文件中会生成对应的文件夹和组件。 阅读全文

posted @ 2019-05-30 23:18 猫头唔食鱼 阅读(227) 评论(0) 推荐(0) 编辑

摘要:1.创建项目 2.下载依赖包 3.运行 浏览器自动打开 localhost:4200,运行成功 阅读全文

posted @ 2019-05-30 16:55 猫头唔食鱼 阅读(391) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示