xinxin?

08 2020 档案

JavaScript:记录一些字符串和数组常用的方法
摘要:字符串: 字符串的方法:注意:都不会改变原来的字符串,返回值为新的字符串。如果(1,2),一般是包含小标1,不包含下标2 str.charAt(i): 取str的第i+1个字符,类似数组的arr[i]. str.substring(start,end):抽取字符串。和slice基本一样,不识别负数 阅读全文

posted @ 2020-08-05 23:39 xinxin? 阅读(161) 评论(0) 推荐(0)

JavaScript:正则表达式匹配规则
摘要:正则表达式的语法规则:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> 阅读全文

posted @ 2020-08-05 23:19 xinxin? 阅读(783) 评论(0) 推荐(0)

JavaScript:常用的一些数组遍历的方法
摘要:常用的一些遍历数组的方法: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <script type="text/javascript"> var students=[ { nam 阅读全文

posted @ 2020-08-04 23:30 xinxin? 阅读(177) 评论(0) 推荐(0)

Angular:组件之间的通信@Input、@Output和ViewChild
摘要:①父组件给子组件传值 1、父组件: ts: export class HomeComponent implements OnInit { public hxTitle = '我是首页的头部'; constructor() { } ngOnInit(): void { } run(): void { 阅读全文

posted @ 2020-08-01 17:20 xinxin? 阅读(271) 评论(0) 推荐(0)

Angular:管道和自定义管道
摘要:①管道的使用,更多管道在angular官网上有 <p>全部转为大写:{{'hahahah' | uppercase}}</p> <p>保留两位小数:{{1.45555 | number:'1.1-2'}}</p> ②自定义管道 1、使用ng g pipe创建一个管道类文件 2、对pipes/pow. 阅读全文

posted @ 2020-08-01 16:37 xinxin? 阅读(238) 评论(0) 推荐(0)

Angular:自定义属性指令
摘要:①在命令行窗口下用 CLI 命令ng g directive创建指令类文件 ②将directives/light.directive.ts文件改造一番 import { Directive, ElementRef, HostListener, Input } from '@angular/core' 阅读全文

posted @ 2020-08-01 16:05 xinxin? 阅读(271) 评论(0) 推荐(0)

导航