angular

Angular , creating new project fail

二次信任 提交于 2021-02-10 17:59:32
问题 I am new to Angular. Successfully installed Angular by Cls, but when i create project by typing "ng new projectName". It fails. gives me this $ ng new p1 CREATE p1/angular.json (3512 bytes) CREATE p1/package.json (1306 bytes) CREATE p1/README.md (1019 bytes) CREATE p1/tsconfig.json (384 bytes) CREATE p1/tslint.json (2805 bytes) CREATE p1/.editorconfig (245 bytes) CREATE p1/.gitignore (503 bytes) CREATE p1/src/environments/environment.prod.ts (51 bytes) CREATE p1/src/environments/environment

How can I include the Telegram login widget in an Angular app?

对着背影说爱祢 提交于 2021-02-10 17:50:41
问题 I want to include the Telegram login widget in my Angular application. For this, you have to include the following script: <script async src="https://telegram.org/js/telegram-widget.js?5" data-telegram-login="bot_name" data-size="large" data-auth-url="https://myurl.example/api/telegram" data-request-access="write"></script> Embedding scripts in Angular templates is not allowed, it will just be removed. (However, it is possible to include a script tag via this hack.) Is there a non-hacky way

How to Make a Generic Resolver in Angular (2+)

霸气de小男生 提交于 2021-02-10 17:50:34
问题 I am looking to create a super generic API Resolver in my application. I want all "GET" requests, possibly extend it to other verbs in the future, to use this resolver. I want to be able to pass the URL and the verb of the request to the resolver and then handle making the function call from there. This resolver will be used on any Angular route definition with a param called "id" and I want to be able to specify the return type for this resolver. This is conceptually what I am looking to do,

How to pass extra parameters to RxJS map operator

妖精的绣舞 提交于 2021-02-10 17:47:46
问题 In an Angular app, I use HttpClient and RxJS operators to make some API calls. For example: return this.httpClient.put(url, JSON.stringify(treeOptions)) .pipe( map(this.extractTreeData), catchError(this.handleError) ); The extractTreeData method basically changes some properties returned by the API: private extractTreeData(res: any) { let apiTree = res.data; // The tree comes inside the 'data' field let newTree : any; try { let str = JSON.stringify(apiTree); str = str.replace(/"children"/g, '

How to Make a Generic Resolver in Angular (2+)

送分小仙女□ 提交于 2021-02-10 17:47:03
问题 I am looking to create a super generic API Resolver in my application. I want all "GET" requests, possibly extend it to other verbs in the future, to use this resolver. I want to be able to pass the URL and the verb of the request to the resolver and then handle making the function call from there. This resolver will be used on any Angular route definition with a param called "id" and I want to be able to specify the return type for this resolver. This is conceptually what I am looking to do,

How to fix “zone is not defined” in this project

耗尽温柔 提交于 2021-02-10 17:44:40
问题 I've migrated a project from Node 6 to Node 10 and in the process made some changes and version upgrades which resulted in failing test cases and whatever fixes I tried, the test are still failing on "ReferenceError: Zone is not defined" I've tried changing the versions of different dependencies incrementally from basic to latest and still the tests would not pass. Here is the Package json: "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "build:prod": "ng build --prod --env

PrimeNG 6 dropdown not correctly showed

倾然丶 夕夏残阳落幕 提交于 2021-02-10 17:44:07
问题 I migrated to PrimeNG 6.1.7 and I've a problem with p-dropdown. This is my code import in app.module (taken from a simple example): import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {DropdownModule} from 'primeng/dropdown'; // include this for dropdown support @NgModule({ declarations: [ AppComponent ], imports

Ionic application targets API level 25 and must target at least API level 26

不想你离开。 提交于 2021-02-10 17:36:29
问题 I am creating an android application using ionic 3, when i attempt to upload to playstore i get an error that my app targets api 25, when i check my project.property the value of target =android-26, same with my androidManifest.xml the value of targetSdkVersion = 26, how do i set the target again. Below is my ionic info Ionic: ionic (Ionic CLI) : 4.4.0 (C:\Users\IETECH\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.1.8 Cordova: cordova

Ionic application targets API level 25 and must target at least API level 26

拟墨画扇 提交于 2021-02-10 17:36:05
问题 I am creating an android application using ionic 3, when i attempt to upload to playstore i get an error that my app targets api 25, when i check my project.property the value of target =android-26, same with my androidManifest.xml the value of targetSdkVersion = 26, how do i set the target again. Below is my ionic info Ionic: ionic (Ionic CLI) : 4.4.0 (C:\Users\IETECH\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.1.8 Cordova: cordova

Ionic application targets API level 25 and must target at least API level 26

浪尽此生 提交于 2021-02-10 17:35:39
问题 I am creating an android application using ionic 3, when i attempt to upload to playstore i get an error that my app targets api 25, when i check my project.property the value of target =android-26, same with my androidManifest.xml the value of targetSdkVersion = 26, how do i set the target again. Below is my ionic info Ionic: ionic (Ionic CLI) : 4.4.0 (C:\Users\IETECH\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.1.8 Cordova: cordova