This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IDirtyControl { | |
field: string, | |
type: string, | |
convertTo: string, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<nz-alert nzType="error" [nzMessage]="nonFieldErrors" *ngIf="non_field_errors.length > 0" nzShowIcon> | |
<ng-template #nonFieldErrors> | |
<nz-list> | |
<nz-list-item *ngFor="let error of non_field_errors">{{ error }}</nz-list-item> | |
</nz-list> | |
</ng-template> | |
</nz-alert> | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpErrorResponse } from '@angular/common/http'; | |
import { Injectable } from '@angular/core'; | |
import { FormGroup } from '@angular/forms'; | |
import { Router } from '@angular/router'; | |
import { NzMessageService } from 'ng-zorro-antd/message'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ErrorService { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm(validateForm.value)"> | |
<nz-form-item> | |
<nz-form-label [nzSpan]="9" nzRequired>Name</nz-form-label> | |
<nz-form-control [nzSpan]="6" [nzErrorTip]="nameError"> | |
<input nz-input formControlName="name" placeholder="Name" /> | |
</nz-form-control> | |
<ng-template #nameError let-control> | |
<ng-container *ngIf="control.hasError('serverError')"> | |
{{ control.errors.serverError }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to override the defaultsauto[] | |
[ | |
{ | |
"key": "ctrl+l ctrl+t", | |
"command": "editor.action.transformToTitlecase" | |
}, | |
{ | |
"key": "ctrl+l ctrl+l", | |
"command": "editor.action.transformToLowercase" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { AbstractControl, FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms'; | |
import { Router } from '@angular/router'; | |
import { take } from 'rxjs/operators'; | |
import { HttpErrorResponse } from '@angular/common/http'; | |
import { ErrorService } from 'src/app/services/error.service'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<nz-breadcrumb> | |
<nz-breadcrumb-item> | |
<a routerLink="/"> | |
<i nz-icon nzType="home"></i> | |
</a> | |
</nz-breadcrumb-item> | |
<nz-breadcrumb-item> | |
<a routerLink="/university"> | |
<img src="assets/images/university_icon.svg" height="20px" width="20px" alt=""> |
NewerOlder