angular5

How to I get current time from angular material Date picker?

霸气de小男生 提交于 2021-02-08 08:21:37
问题 I am using angular material datepicker https://material.angular.io/components/select/overview but this returns only the date and not the current time : Mon May 28 2018 00:00:00 GMT+0530 (IST) Is there any way I can get the current time also from this? 回答1: You can use the ngModelChange to parse the date before set it to your model, i recommend you momentJS for easy date manipulations. in the HTML <input [ngModel]="date" (ngModelChange)="onDataChange($event)" matInput [matDatepicker]="picker"

Angular: How to implement ng-include like functionality in Angular 5?

99封情书 提交于 2021-02-07 19:51:46
问题 Is there any functionality to render html file dynamically inside a components template based on the path? I have the path to local html file now I need to display the content of it inside a components template. In Anular 1.x we had ng-include, any similar functionality in Angular5? <div class="row blogdetail-container"> {{blogSelected.description}} // currently interpolates the path </div> variable blogSelected.description contains the path to html file and I want to replace its content here

Angular: How to implement ng-include like functionality in Angular 5?

我的梦境 提交于 2021-02-07 19:51:16
问题 Is there any functionality to render html file dynamically inside a components template based on the path? I have the path to local html file now I need to display the content of it inside a components template. In Anular 1.x we had ng-include, any similar functionality in Angular5? <div class="row blogdetail-container"> {{blogSelected.description}} // currently interpolates the path </div> variable blogSelected.description contains the path to html file and I want to replace its content here

Cannot find module “popper.js” Angular 5 Visual Studio 2017 asp.net core

北城以北 提交于 2021-02-07 09:31:06
问题 I updated my Angular's verision from 4 to 5. Below is the screenshot, I followed the instruction as per the link http://www.talkingdotnet.com/upgrade-angular-4-app-angular-5-visual-studio-2017/ package.json file { "name": "VotingWebsite", "private": true, "version": "0.0.0", "scripts": { "test": "karma start ClientApp/test/karma.conf.js" }, "devDependencies": { "@angular/animations": "5.2.1", "@angular/common": "5.2.1", "@angular/compiler": "5.2.1", "@angular/compiler-cli": "5.2.1", "@angular

Running Angular 5 app inside webworker causes window object to be undefined

老子叫甜甜 提交于 2021-02-07 02:13:29
问题 I am trying to upgrade this (ngx-admin) free Angular template to Angular 5 and then trying to run the whole app inside WebWorker as mentioned in this SO Post. I successfully upgraded the app to Angular 5 and it is working fine but when I try to configure the app to run inside Webworker it gives me following error: The complete code (modified to Angular 5 and webworker) can be found here I tried to add DefinePlugin in my webpack config but no luck. webpack.config.json: new DefinePlugin({

Running Angular 5 app inside webworker causes window object to be undefined

让人想犯罪 __ 提交于 2021-02-07 02:04:49
问题 I am trying to upgrade this (ngx-admin) free Angular template to Angular 5 and then trying to run the whole app inside WebWorker as mentioned in this SO Post. I successfully upgraded the app to Angular 5 and it is working fine but when I try to configure the app to run inside Webworker it gives me following error: The complete code (modified to Angular 5 and webworker) can be found here I tried to add DefinePlugin in my webpack config but no luck. webpack.config.json: new DefinePlugin({

how to add canonical link in angular 5

余生长醉 提交于 2021-02-06 20:45:46
问题 How to add canonical link in angular 5 dynamically <link rel="canonical" href="http://foobar.com/gotcah"/> 回答1: Facing the same issue I searched around and found a guide on how to do this: https://www.concretepage.com/angular/angular-title-service-and-canonical-url It is using Angular 6 though, but I think it is backwards compatible to 5. It basically suggests creating a Service (SEOService) for facilitating creating the canonical link whereever it is injected. It injects the Angular DOCUMENT

how to add canonical link in angular 5

☆樱花仙子☆ 提交于 2021-02-06 20:44:46
问题 How to add canonical link in angular 5 dynamically <link rel="canonical" href="http://foobar.com/gotcah"/> 回答1: Facing the same issue I searched around and found a guide on how to do this: https://www.concretepage.com/angular/angular-title-service-and-canonical-url It is using Angular 6 though, but I think it is backwards compatible to 5. It basically suggests creating a Service (SEOService) for facilitating creating the canonical link whereever it is injected. It injects the Angular DOCUMENT

mat-slide-toggle shouldn't change it's state when I click cancel in confirmation window

南笙酒味 提交于 2021-02-04 23:57:39
问题 When I checked the slide toggle it should work as expected. But when I try to uncheck it there is a confirmation window asking if you are sure. When I click cancel in that confirmation window, still the toggle changes to unchecked, which shouldn't happen. It should stay in the same state. Here is my Html and TS Code // html <mat-slide-toggle (change)="change($event)" [checked]="isChecked()" > To-pay </mat-slide-toggle> TS code: // ts change(e) { if(this.checked) { if(confirm("Are you sure"))

How to use Hammer in angular universal

馋奶兔 提交于 2021-02-04 20:00:30
问题 Can anyone pls help me to fix hammer error })(window, document, 'Hammer'); ^ ReferenceError: window is not defined at Object._MAP.8 (/Users/ks89/git/universal-starter/dist/server.js:126460:4) in angular universal. 回答1: You need to import hammer from main.ts , not directly from the module. That way, it won't be included server side https://github.com/angular/material2/blob/master/guides/getting-started.md#step-5-gesture-support 来源: https://stackoverflow.com/questions/49335441/how-to-use-hammer