上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 44 下一页
摘要: 1,结构型指令 ①影响html结构的指令 ②*ngFor *ngIf *ngSwitchCase *ngSwitchDefault 2,属性型指令 ①会改变某个元素、组件或其他指令的外观或行为 ②比如,内置的NgStyle指令可以同时修改元素的多个样式 3,常用的属性型指令 ①事件绑定 步骤一:在对 阅读全文
posted @ 2020-01-16 19:49 shanlu 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 练习1:多重判断 ①创建一个组件demo05,在这个组件中,有一个变量uName,如果用户名是lucy显示“你好,Lucy”,如果是Tom,显示“你好,Tom”,否则其他情况时,显示“请去登陆” ②初始化一个对象数组stuList(包含5个元素),每个对象都包含 name/age/sex/score 阅读全文
posted @ 2020-01-16 19:24 shanlu 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 多重判断 *ngSwitchCase *ngSwitchDefault,有一个使用前提:通过[ngSwitch]去指定判断条件 demo04.component.ts demo04.component.html 阅读全文
posted @ 2020-01-16 17:35 shanlu 阅读(254) 评论(0) 推荐(0) 编辑
摘要: ①添加插件 在demo.component.ts中按下a-c 再回车,自动创建组件格式 ②创建Demo04Component来渲染Angular选择指令 选择指令: <any *ngIf="表达式"></any> demoo4.component.ts demo04.component.html ③ 阅读全文
posted @ 2020-01-16 17:19 shanlu 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1,模板页面的html上需要声明Thymeleaf的命名空间,<html xmlns:th="http://www.thymeleaf.org"> 2,文本标签 th:text/th:utext th:text进行文本替换,不会解析html <p th:text="text标签: + ${msg}" 阅读全文
posted @ 2020-01-16 13:19 shanlu 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 循环指令 *ngFor 语法:<any *ngFor="let tmp of list "></any> demo03.component.ts app.component.ts app.module.ts 当不使用*ngFor时, 注意template模板解析要加双引号 {{ }} 循环指令② 阅读全文
posted @ 2020-01-15 23:22 shanlu 阅读(397) 评论(0) 推荐(0) 编辑
摘要: 练习 在app目录创建一个 demo02 的文件夹,创建一个demo02.component.ts的文件,导出组件类为 Demo02Component,指定选择器的名称为 demo02,模板中去指定显示一个有5个元素构成的列表 在渲染的时候,根组件中只显示该Demo02Component demo0 阅读全文
posted @ 2020-01-15 23:09 shanlu 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 1,在VS code 中打开一个Angular项目 2,在终端(ctrl+ `)输入 npm start,启动开发服务器,开启4200端口 (关闭 ctrl+c y+enter) 3,在src目录下有一个文件叫做index.html,在body中渲染了自定义组件 app-root,对应的是app目录 阅读全文
posted @ 2020-01-15 23:03 shanlu 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 1,安装Node.Js https://nodejs.org/en/ 2,验证是否成功安装Node.Js ①cmd 输入 node -v 3,npm安装以及验证 新版的NodeJS已经集成了npm,所以之前npm也一并安装好了。同样可以使用cmd命令行输入"npm -v"来测试是否成功安装 4,添加 阅读全文
posted @ 2020-01-15 22:28 shanlu 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1,页面简单结构搭建 ad.html 2,方式一,创建一个 close.php的页面 ad.php close.php (只要有人来请求我,意味着这个人不想再看到广告,我们就给这个用户开张小票 ) 3,方式二,传参 ad.php 阅读全文
posted @ 2019-10-01 20:33 shanlu 阅读(193) 评论(0) 推荐(0) 编辑
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 44 下一页