angular6

Pre-populating and validating date in Angular 6 reactive form

情到浓时终转凉″ 提交于 2020-01-04 14:02:01
问题 All the rest of the fields are getting pre-populated except date for me. For testing purposes, i have hard coded the date as MM/DD/YYYY. From the DB, i'll get Date and Time, so i'll need to use the pipe to make it MM/DD/YYYY (am i correct about this?) component code this.projectForm = new FormGroup({ 'name': new FormControl(project.ProjectName, [Validators.required, Validators.minLength(3), Validators.maxLength(20)]), 'customerName': new FormControl(project.CustomerName, [Validators.required,

Pre-populating and validating date in Angular 6 reactive form

狂风中的少年 提交于 2020-01-04 14:01:24
问题 All the rest of the fields are getting pre-populated except date for me. For testing purposes, i have hard coded the date as MM/DD/YYYY. From the DB, i'll get Date and Time, so i'll need to use the pipe to make it MM/DD/YYYY (am i correct about this?) component code this.projectForm = new FormGroup({ 'name': new FormControl(project.ProjectName, [Validators.required, Validators.minLength(3), Validators.maxLength(20)]), 'customerName': new FormControl(project.CustomerName, [Validators.required,

Paginator not working on multiple table with angular material table

天大地大妈咪最大 提交于 2020-01-04 06:25:49
问题 I have few table in my application with mat-paginator. The first table paginator(#paginatorregin) working fine.The second table paginator(#paginatorcountry) and sorting is not working but length applied on pagination table based on how much value i got from json object, here i add my code below <table mat-table [dataSource]="regionsDataSource" matSort> <ng-container matColumnDef="regions"> <th mat-header-cell *matHeaderCellDef mat-sort-header> Regions</th> <td mat-cell *matCellDef="let

dynamically add div container in angular 6

偶尔善良 提交于 2020-01-03 14:59:12
问题 How to dynamically add div containers in angular?. Please look at my html code. Whenever I will click "Add" button, one new div should add left side of that button. Dynamically it should add multiple containers based on how any clicks. Everything should add in horizontal wise. If it is more containers by default it should add scroll and it be in uniform. Can anyone please help me to do this in angular 6. #content{ width:100%; height:90px; border:1px solid black; } #contentInside{ width:100px;

Angular6 - canvas.drawImage() not working

纵饮孤独 提交于 2020-01-03 13:38:07
问题 I want to put image on canvas. initially I used image as background. But whenever I convert canvas to image, background image is not getting copied. Hence I tried to draw image on canvas. I am choosing image from device image gallery. Storing the image url as string and passing to next component. I checked, able to get the value. Please see below code and let me know what I did wrong. 1. HTML <canvas no-bounce id="canvas" (touchstart)='handleStart($event)' (touchmove)='handleMove($event)'

Angular6 - canvas.drawImage() not working

时光毁灭记忆、已成空白 提交于 2020-01-03 13:35:54
问题 I want to put image on canvas. initially I used image as background. But whenever I convert canvas to image, background image is not getting copied. Hence I tried to draw image on canvas. I am choosing image from device image gallery. Storing the image url as string and passing to next component. I checked, able to get the value. Please see below code and let me know what I did wrong. 1. HTML <canvas no-bounce id="canvas" (touchstart)='handleStart($event)' (touchmove)='handleMove($event)'

Remove duplicate names in a column

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 01:12:22
问题 In my angular 6 application, i am making a table with the contents from products array like, Ts: products: any = { "productOne": [ { "id": 1, "product_name": "Product One", "productOneProperties": [ { "id": 1, "property_name": "Length", "property_value": "12cm" }, { "id": 2, "property_name": "Width", "property_value": "10cm" }, { "id": 3, "property_name": "Height", "property_value": "20cm" }, ] } ], "productTwo": [ { "id": 2, "product_name": "Product Two", "productTwoProperties": [ { "id": 1,

How to get rid from redundant request in Angular 6 service?

社会主义新天地 提交于 2020-01-02 10:54:45
问题 I have 3 independent places in my code which call VerificationService method getOrganizationView() . getOrganizationView(): Observable<any> { return this.httpClient.http.post(...) } First place is principal service: @Injectable() export class Principal { constructor(private verificationService: VerificationService) {} identity(force?: boolean): Promise<any> { return this.verificationService.getOrganizationView().toPromise().then((response ) => { ... }) } } And one more service called

Angular 6 Dynamic Views with Auxiliary Routes and clean URL's

随声附和 提交于 2020-01-02 08:48:34
问题 In my Angular 6 project, I have some components that have a sidebar, and some of them don't. I tried to do this with auxiliary routes and it worked, but the URL's are ugly as ...! -- What I do: const routes: Routes = [ { path: 'login', component: LoginComponent }, { path: 'search', component: SearchComponent }, { path: 'sidebar', outlet: 'sidebar', component: SidebarComponent } which gives me them possible URL's https://localhost:4200/login - (login without sidebar) https://localhost:4200

How to remove the outline mat-form-filed border corner radius

為{幸葍}努か 提交于 2020-01-02 07:09:23
问题 I am using the angular material outline mat-form-field to design a form. I am getting the default mat-form-field outline text-box view with a border corner radius. Is there any way to remove the border corner radius of the outline mat-form-field and convert into a square text box view. I tried to change the default styles of the angular material mat-form-field with the following, but it's not working. //css .mat-form-field-appearance-outline .mat-form-field-outline-start .alignment{ border