随笔分类 -  angular

摘要:管道的作用就是将原始值进行转化处理,转换为所需要的值; 一、内置管道 1 <h1>大小写转换</h1> 2 {{'HeLLO worLD' | uppercase}} 3 <!-- 转换为大写 --> 4 <br /> 5 {{'HeLLO worLD' | lowercase}} 6 <!-- 转 阅读全文
posted @ 2021-12-06 17:33 GISer杰 阅读(274) 评论(0) 推荐(0)
摘要:Style 一、通过 ngStyle 1 <p [ngStyle]="{'color':'red'}">ngStyle演示</p> 2 3 <p [ngStyle]="{'color':tempColor}">ngStyle演示</p> 4 // tempColor定义在ts文件中,数据类型为字符串 阅读全文
posted @ 2021-12-06 09:22 GISer杰 阅读(90) 评论(0) 推荐(0)
摘要:文件结构: 定义路由时,有两种定义方式:①在 app.module.ts 中定义;②定义路由模块( app-routing.module.ts ),将路由模块导入到 app.module.ts 中,此处我们主要演示第二种,如果程序比较简单,路由数量单一,可以直接定义在 app.module.ts 中 阅读全文
posted @ 2021-12-02 09:39 GISer杰 阅读(665) 评论(0) 推荐(0)
摘要:回调函数 Promise Rxjs 1、回调函数 1 /* 利用回调函数执行异步操作 */ 2 getCallBackData(callback) { // 把函数作为参数传递进去 3 setTimeout(() => { 4 let data = 'this is callback data'; 阅读全文
posted @ 2021-11-26 16:07 GISer杰 阅读(256) 评论(0) 推荐(0)