angular5

Angular Material mat-datepicker (change) event and format

跟風遠走 提交于 2019-12-29 08:28:28
问题 I am using angular material datepicker directive and I have few problems. 1. When I open date picker dialog and select any date, date shows up in input text box, but I want to call a function when ever any change occur in input text box. Right now if I manually enter any value in input text box, I am triggering function using (input) directive and it is working fine as shown in code. I want to trigger same function when date gets change using date picker dialog. 2. I also want to change the

How to perform DOM manipulation in Angular components?

℡╲_俬逩灬. 提交于 2019-12-28 05:31:10
问题 How do we get hold of DOM elements in Angular (Version 2.x and above)? The basic functions like addClass, removeClass etc are not availble in typescript so how do we do these DOM manipulations in angular components? Please suggest if any. TIA 回答1: You can reach your DOM elements by using ViewChild decorator in this way: @Component({ .... templateUrl: 'mytemplate.html' }) export class MyComponent{ @ViewChild('selector') private someName; constructor() { //this is your dom //this.someName

Angular5: Deploying Angular application to multiple clients

女生的网名这么多〃 提交于 2019-12-28 04:21:12
问题 I am developing an angular application which is a product and deployed to multiple clients. Clients will take this angular application and host it in their servers. So the Services' url will be different for the clients. I have seen solutions that talk about dev, prod. But that will not be applicable in this case. I am looking for a config file that is similar to .net config file. I have created a separate app.config.ts file but that gets built when I do ng build. I am looking for a solution

Use OpenLayers 4 with Angular 5

别等时光非礼了梦想. 提交于 2019-12-28 04:07:26
问题 I'm trying to use OpenLayers 4 in Angular 5. Basically I just want to implement the QuickStart example from the official OpenLayers Site. What I have done so far: npm install ol --save to download the ol package angular-cli.json added those lines to the angular-cli.json. Saw that this has to be done on another example on Stackoverflow. The ol.css file exists. The ol.js file doesnt. So I don't know if this is the right or the wrong way but it can clearly not work. My angular project consists

Refresh page get log out automatically in angular 5

雨燕双飞 提交于 2019-12-25 18:42:07
问题 I'm using firebase for the signIn and signup. that is my authService look like : token: string; authenticated: boolean = false; signinUser(email: string, password: string) { firebase .auth() .signInWithEmailAndPassword(email, password) .then(response => { this.authenticated = true; console.log('authService-->signinUser-->authenticated', this.authenticated); //Set the a wallet using a combination of the email and the name of the network e.g. Majd@gmail.com@stschain this.dataService.setWallet(`

Equal distance between Div's using Angular 5 and Flex Layout

折月煮酒 提交于 2019-12-25 14:41:43
问题 I am currently using Angular 5 that runs a loop and displays several containers as a list (Thousands of results). <div class="temp-list"> <div> <ng-container #activityCards *ngFor="let activity of (activityCollection.activities | filters: filtersObject); let i = index;"> <div class="activity-card-container" *ngIf="checkIsVisible(i)" [ngClass.gt-md]="{'display-inline': true, 'large-activity': i < 3, 'medium-activity': i > 2 && i < 7, 'small-activity': i > 6 }" > <activity-card [activity]=

Equal distance between Div's using Angular 5 and Flex Layout

断了今生、忘了曾经 提交于 2019-12-25 14:41:11
问题 I am currently using Angular 5 that runs a loop and displays several containers as a list (Thousands of results). <div class="temp-list"> <div> <ng-container #activityCards *ngFor="let activity of (activityCollection.activities | filters: filtersObject); let i = index;"> <div class="activity-card-container" *ngIf="checkIsVisible(i)" [ngClass.gt-md]="{'display-inline': true, 'large-activity': i < 3, 'medium-activity': i > 2 && i < 7, 'small-activity': i > 6 }" > <activity-card [activity]=

Angular2 radio button validation

三世轮回 提交于 2019-12-25 02:47:24
问题 How to validate radio button and checkbox and zip code in angular 2 i tried but not working.Anyone can find the solutions.please help me to resolve this issue. Demo:https://stackblitz.com/edit/angular-7-template-driven-form-validation-ndspdl?file=app/app.component.html <div class="form-group"> Radio Buttons: <div *ngFor="let enum of enum_details"> <label for="enum_answer_{{enum.name}}"> <input id="enum_answer_{{enum.name}}" [value]='enum.name' type="radio" name="enums" enums="ngModel" [

how to pass data between one component to another which is on same router-outlet

你。 提交于 2019-12-25 02:18:29
问题 app.component.html I have two components 1) ResetPassword 2) LoginComponent on the same router-outlet. on successfully resetting the password. I'm redirecting to login component. How do I pass data from ResetPassword to LoginComponent? I tried using subscribe method to do this but that is not working. Can someone help me fix this. LoginService export class LoginService{ private messageSource = new BehaviorSubject(''); currentMessage = this.messageSource.asObservable(); setResetPassword

How to show components in the content area of home component instead of separate page in Angular 5

人盡茶涼 提交于 2019-12-25 01:48:39
问题 I am new to Angular 5 ,Here I am facing a problem with component routing . What I want to do is ,When a user open the app first it should show a login screen (login screen with full height and width of browser window).Once the user is successfully validated then the user get into the Home Component . Here Home component has Toolbar and Side menu bar ,If user selected any any from side menu bar I want to show the relevant(component) data in the content area of the home component. As of now