angular
huiqian1398
这个作者很懒,什么都没留下…
展开
-
angular6 app-route 明明配置没有问题 但是链接报错404
发现一个头疼的问题,虽然没有发现原因,但是知道如何解决 const routes: Routes = [ { path: "", component: HomeComponent, canActivate: [AuthGuard], data: { title: "Home" } }, { path: "login", component: LoginComponent...原创 2018-11-06 11:38:37 · 1018 阅读 · 0 评论 -
angular6 mat-select 加入ngModelChange事件之后无法使用表单验证
这里是因为ngModelChange在初始化就会运行,所以导致无法使用表单验证,这里改用selectionChange事件 问题解决 <mat-form-field> <mat-select placeholder="{{'sysadmin.account.username' | translate}}" name="user" [(ng...原创 2018-11-06 11:43:55 · 4855 阅读 · 0 评论 -
angular6 表单验证 mark
TS下 import {Component} from '@angular/core'; import {FormControl, Validators} from '@angular/forms'; /** * @title Input with error messages */ @Component({ selector: 'input-errors-example', t...原创 2018-11-06 14:04:08 · 826 阅读 · 0 评论 -
正则表达式,兼容正整数或负整数的写法
number2 = new FormControl('', [Validators.required, Validators.max(100), Validators.min(-100), Validators.pattern('^(-?)(0|[1-9][0-9]*)$')]);原创 2018-11-07 14:19:01 · 4088 阅读 · 0 评论 -
angular +asp.net 时间戳问题
在构建程式的时候发现前台时间戳转日期比较麻烦,所以改写在后台转换,因为前后台都是我写就是这样任性 前台angular 日期转时间戳 var date= (new Date().getTime()) 后台时间戳转日期 DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970,...原创 2018-11-12 14:51:12 · 154 阅读 · 0 评论 -
TypeScript for in 对数组和对象操作时
for..in 方法 对数组操作时 let list = [4, 5, 6]; for (let i in list) { console.log(i); // "0", "1", "2", } for (let i of list) { console.log(i); // "4", "5", "6" } for in 对数组对象操作时 打印属性 let l原创 2018-11-14 15:00:10 · 6346 阅读 · 0 评论 -
angular6 table 使用ng for 添加列
在使用过程中发现,后台获取到的数据,属性名称首字母到前台会变小写,而我们又想显示的列名首字母为大写 mat-heard-cell为显示名称,我们只需要使用管道将首字母大写即可 <table mat-table [dataSource]="dataSource" matSort> <ng-container [matColumnDef]="column" *...原创 2018-11-15 09:51:39 · 3633 阅读 · 0 评论