angular5

Why error in Angular 5 as : has no exported member 'OpaqueToken'.?

微笑、不失礼 提交于 2019-12-18 07:03:19
问题 I have an Angular 4 application, which I am upgrading to Angular 5. I am getting the following error. ERROR in src/app/application/services/generated/variables.ts(1,10): error TS2305: Module '"..../node_modules/@angular/core/core"' has no exported member 'OpaqueToken'. Code snippet is : import { OpaqueToken } from '@angular/core'; export const BASE_PATH = new OpaqueToken('basePath'); export const COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', 'ssv': ' ', 'pipes': '|' } This code is been

Can't resolve all parameters for AppComponent

白昼怎懂夜的黑 提交于 2019-12-18 04:55:19
问题 i'm building big project, this is started part of it. my problem is very common, however I did not find a way to solve it. really need your help! I get an error of type. I will be glad to any help Uncaught Error: Can't resolve all parameters for AppComponent: (?). at syntaxError (main-client.js:52112) at CompileMetadataResolver._getDependenciesMetadata (main-client.js:67193) at CompileMetadataResolver._getTypeMetadata (main-client.js:67028) at CompileMetadataResolver

How to call external javascript function in angular 5?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 04:23:49
问题 I have downloaded a theme from this link. I have to define script and CSS in index.html file. index.html (body section) <body> <app-root></app-root> <script type="text/javascript" src="./assets/js/main.85741bff.js"></script> <script type="text/javascript" src="./assets/js/common.js"></script> </body> I have defind my function in common.js and call it from main.85741bff.js file. common.js (function) document.addEventListener("DOMContentLoaded", function (event) { masonryBuild();

ngFor length in Angular 5

笑着哭i 提交于 2019-12-17 22:28:41
问题 I have three buttons : All (Reals+ Fakes), Reals(total count), Fakes(total count) I am trying to get the total count of my total feeds which will be shown in All. And the total count of feed.feed_type != '' which will be shown Reals. And the total count of feed.feed_type == '' which will be shown Fakes. Feeds Model export class Feeds { feed_id: string; feed_category: string; feed_title: any; feed_description: string; feed_terms: string; feed_type: string; checked: false; } Feeds Component:

How can i use foxTooltip with Angular?

巧了我就是萌 提交于 2019-12-17 21:23:55
问题 I want to import the library foxToolTip with angular. I tried import * as foxToolTip from 'fox.tooltip.js'; but the [ts] doesn't found the module fox.tooltip.js I installed the version : fox.tooltip.js: 1.0.13, 回答1: In case of Angular 5, inside .angular-cli.json 's scripts array, add the path to fox.tooltip.js "scripts": [ "../node_modules/fox.tooltip.js/dist/foxToolTip.min.js" ], In case of Angular 6, inside angular.json 's scripts array, add the path to fox.tooltip.js without ../ "scripts":

RequestOptions deprecated symbol error in Angular 5

坚强是说给别人听的谎言 提交于 2019-12-17 20:30:04
问题 I'm trying to adapt code in Angular 4 to Angular 5. I made many changes but I had an error about RequestOptions . The code is about authentication and this is where I have the error: import { Injectable } from '@angular/core'; import { RequestOptions} from '@angular/http'; import {User} from '../model/model.user'; import 'rxjs/add/operator/map'; import {HttpClient, HttpHeaders} from '@angular/common/http'; @Injectable() export class AuthService { constructor(public http: HttpClient) { }

Uncaught (in promise): Error: StaticInjectorError(AppModule)[options]

孤者浪人 提交于 2019-12-17 16:27:18
问题 I have a strange error. Usually (I did my googling), in this case of errors Angular specifies in square brackets which exactly module/service/provider/etc caused the problem. However here, it says only options . I tried adding HttpClientModule, HttpModule, Options to providers/imports - no success. Tried to follow this debugging guide Debugging Unknown provider in minified angular javascript but also it brought me to nothing (no invoke on the call stack, just invokes associated with Zone ) my

Angular 5 internationalization

爱⌒轻易说出口 提交于 2019-12-17 15:29:58
问题 I'm building an application using the latest Angular5 and what I need is for a user to be able to switch languages. I've never had to implement this in an Angular2+ (actually I'm using Angular5). I need to set translations in two places: Component's template html - change labels to the specified language In code in the component.ts file - I may need to translate some strings that are built dynamically under particular conditions in the code I was looking at ngx-translation and it looks to do

How to update / upgrade from Angular 4 to Angular 5+

走远了吗. 提交于 2019-12-17 08:25:11
问题 I need to update my project from Angular 4 to Angular 5+ , I need to change all following dependencies to Angular 5+. I also updated Angular CLI to 1.5.0. I tried to create new project but it seems to create only Angular 4 project. ng new NG5_Project "dependencies": { "@angular/animations": "^4.2.4", "@angular/common": "^4.2.4", "@angular/compiler": "^4.2.4", "@angular/core": "^4.2.4", "@angular/forms": "^4.2.4", "@angular/http": "^4.2.4", "@angular/platform-browser": "^4.2.4", "@angular

angular-i18n work-around for translations in code?

淺唱寂寞╮ 提交于 2019-12-17 06:13:53
问题 We have to wait until Angular 6 for angular-i18n to support translations in code for error messages and such. For those that are using angular-i18n (instead of ngx-translate for instance) what are you doing in the meantime to handle translations in code? It occurs to me that if there are not many strings then a simple language service with methods to get translations by language code and an id would work, but I am interested in something more elegant and "angular". I do not know what the