angular5

Date pipe is Working fine in Html Interpolation but not Working in Mat-DatePicker Input Fields

丶灬走出姿态 提交于 2021-02-10 23:13:58
问题 I want to display a date in dd/MM/YYYY format when a user pick the date using the mat Datepicker but when i use the Datepipe in Datepicker it not shows any Date when we pick <mat-form-field class="box"> <input matInput [matDatepicker]="picker" placeholder="Generate Date" maxlength="10px" [readonly]="isNew1" [ngModel]="quotation?.generateDate | date: 'dd/MM/yy'" (ngModelChange)="quotation.generateDate=$event" [ngModelOptions]="{standalone: true}"> <mat-datepicker-toggle matSuffix [for]="picker

Date pipe is Working fine in Html Interpolation but not Working in Mat-DatePicker Input Fields

烂漫一生 提交于 2021-02-10 23:13:42
问题 I want to display a date in dd/MM/YYYY format when a user pick the date using the mat Datepicker but when i use the Datepipe in Datepicker it not shows any Date when we pick <mat-form-field class="box"> <input matInput [matDatepicker]="picker" placeholder="Generate Date" maxlength="10px" [readonly]="isNew1" [ngModel]="quotation?.generateDate | date: 'dd/MM/yy'" (ngModelChange)="quotation.generateDate=$event" [ngModelOptions]="{standalone: true}"> <mat-datepicker-toggle matSuffix [for]="picker

Date pipe is Working fine in Html Interpolation but not Working in Mat-DatePicker Input Fields

冷暖自知 提交于 2021-02-10 23:10:30
问题 I want to display a date in dd/MM/YYYY format when a user pick the date using the mat Datepicker but when i use the Datepipe in Datepicker it not shows any Date when we pick <mat-form-field class="box"> <input matInput [matDatepicker]="picker" placeholder="Generate Date" maxlength="10px" [readonly]="isNew1" [ngModel]="quotation?.generateDate | date: 'dd/MM/yy'" (ngModelChange)="quotation.generateDate=$event" [ngModelOptions]="{standalone: true}"> <mat-datepicker-toggle matSuffix [for]="picker

There is no directive with “exportAs” set to “ngForm”

一曲冷凌霜 提交于 2021-02-10 13:16:28
问题 I have included FormsModule but it showing me error. There is no directive with “exportAs” set to “ngForm” My Login.component.ts :- import { Component } from '@angular/core'; import { Http, Response , RequestOptions , Headers , URLSearchParams } from '@angular/http'; import {FormsModule} from '@angular/forms'; @Component({ templateUrl: './login.component.html' }) export class LoginComponent { apiRoot : String = "http://httpbin.org"; // search code starts here // data = string; constructor

There is no directive with “exportAs” set to “ngForm”

China☆狼群 提交于 2021-02-10 13:16:02
问题 I have included FormsModule but it showing me error. There is no directive with “exportAs” set to “ngForm” My Login.component.ts :- import { Component } from '@angular/core'; import { Http, Response , RequestOptions , Headers , URLSearchParams } from '@angular/http'; import {FormsModule} from '@angular/forms'; @Component({ templateUrl: './login.component.html' }) export class LoginComponent { apiRoot : String = "http://httpbin.org"; // search code starts here // data = string; constructor

There is no directive with “exportAs” set to “ngForm”

余生颓废 提交于 2021-02-10 13:15:56
问题 I have included FormsModule but it showing me error. There is no directive with “exportAs” set to “ngForm” My Login.component.ts :- import { Component } from '@angular/core'; import { Http, Response , RequestOptions , Headers , URLSearchParams } from '@angular/http'; import {FormsModule} from '@angular/forms'; @Component({ templateUrl: './login.component.html' }) export class LoginComponent { apiRoot : String = "http://httpbin.org"; // search code starts here // data = string; constructor

Angular 5 - Change Style of Host Class in TS File

懵懂的女人 提交于 2021-02-08 11:11:39
问题 I am trying to use ngx-image-cropper and I have found the class of source-image that could be used to perform zoom in of image. In inspect element, the class look like this: [_nghost-c7] > div[_ngcontent-c7] .source-image[_ngcontent-c7] { max-width: 100%; max-height: 100%; } I am trying to change the max-width and max-height from TS file. And I also try to write in CSS File: [_nghost-c7] > div[_ngcontent-c7] .source-image[_ngcontent-c7] { max-width: 150%; max-height: 150%; } But, nothing

Angular 5, Observable and async function

流过昼夜 提交于 2021-02-08 10:38:29
问题 I have been trying to create a function that is similar to http.get(...) but not doing any http. Basically what I have done is that I defined a function async myFunc(): Observable<string> { var myObservable: Observable<string>; //..... // the rest of the function's code comes here // ... return myObservable; } But I always get an error that it is not compatible with ES5/ES3 and should return a Promise object? But I am wondering how it became possible with Angular 5's http.get function? Where

Angular 5, Observable and async function

不想你离开。 提交于 2021-02-08 10:37:48
问题 I have been trying to create a function that is similar to http.get(...) but not doing any http. Basically what I have done is that I defined a function async myFunc(): Observable<string> { var myObservable: Observable<string>; //..... // the rest of the function's code comes here // ... return myObservable; } But I always get an error that it is not compatible with ES5/ES3 and should return a Promise object? But I am wondering how it became possible with Angular 5's http.get function? Where

Angular 5 : select all users with related role OneToMany Relationship

风流意气都作罢 提交于 2021-02-08 10:18:31
问题 I'm trying to select all users with related role, knowing that one role can be related to many contacts and one contact has one role. i tried the code bellow but it return just a blank table, is it a problem with hibernate or with how i called the company name column ? ContactRepository.java @Query("SELECT c, cmp.name FROM Contact c, Company cmp WHERE c.company=cmp.id") public Page<Contact> search(Pageable page); ContactRestService @RequestMapping(value="/searchContacts", method=RequestMethod