Newest angular Questions

Q&A for professional and enthusiast programmers

Google Captcha field not showing

I want to show the google captcha field, I am able to add it in index.html, but not in app html files. suggest any solution. ./src/app/log-in.html <form [formGroup]="logInForm" novalidate (...

Angular 2+ animations parent ngIf

i have a side pannel with background like this <div *ngIf="open$ | async" class="wrapper"> <div class="background" @notificationCenterBackgroundOpenAnimation></div> <div ...

Select multiple point geoJSON data (angular 2 leaflet)

currently i am develop a map using leaflet and retrieve data from geoserver to add layer into my map.. after add layer into map the output will look like this how can i select multiple point and and ...

Angular 4 service behaviour change

I had my Angular 2 code logic written as new Service provider is generated when the Parent Component is re-instantiated each time. But, I guess there are some changes in Angular 4 that prevents ...

Angular2 Global ErrorHandling Dialog

Angular Global ErrorHandling Dialog I'm working on an angular2 application and I'm trying to make some global exception handling for it. Basically what I'm trying to do is catch every exception in ...

How to configure HTML templates loading in angular 1 app using webpack 2?

In my application written with angular 1 i define templates through 'templateUrl' with absolute url like this: .state('home', { url: '/home', templateUrl: '/app/pages/home.html', ...

Custom prefix for components Angular and WebStorm

I initially started a few months ago a project in Angular using Visual Studio Code editor. Today I made the switch to WebStorm and I also upgraded my project to Angular 4.0. While my project is ...

CAS authentication in angular

I am building a dashboard that aims to simplify the usage of multiple business application. The main job of the dashboard is to get data from these applications and send them back to the authenticated ...

Dynamic created elements with different binding

I'm very new to Angular 2. I'm Stuck with dynamic created elements. The app which i build can start multiple timers. When i click add timer a new ion-card is created with a different model. The ...

Is it possible to enable keyboard navigation in PrimeNg ContextMenu?

I'm building a Angular 4 site using PrimeNg. Does anybody know if it's possible to implement keyboard navigation in the contextmenu. Any ideas on how?

Angular2 Material Radio Button Displaying inc

I am using Angular2 Material and I am having issues with the radio dots which are not inside the outer circle. I am using Angular 4 and the latest version of Angular Material @angular/material@2.0.0-...

ngbModal as a generic Confrimation Box

I am trying to create generic confirmation box using ngbmodal, which will be used across the App. In which, Title and message will be passed to the modal from the calling component. I created as a ...

Generate PDF in server (Asp.Net Core) and retrieve in Browser (Angular)

I'm using Asp.Net Core and ItextSharp to generate a PDF report and sending to the Browser. [HttpGet] public async Task<IActionResult> GetStream(string ids) { try { List<...

Angular2 Use animations from outside a component

I have quickly created a simple component @Component({ selector: 'saved-overlay', templateUrl: './saved-overlay.html', exportAs: 'saved-overlay', animations: [ trigger('inOut', [ ...

No provider for service in pipe

I have a custom pipe and a directive that I would like to share some data between. I created a service, that should be handling this. I get the following error: Error: No provider for MyService ...

Custom files inside modules import using Angular

Trying to move from old architecture to the modular world and using the posprocessing package from npm with Three and Angular. When importing a module from postprocessing it gives the following error:...

Angular2 - Issue with conditional attribute

I am using the following to set a conditional attribute on the template : <div [attr.dir]="rtlTextDirection"></div> On the .ts I have this.rtlTextDirection = 'rtl'; I expect to add it ...

Error when unit testing: “Uncaught (in promise) SyntaxError: Unexpected token o in JSON at position 1”

I'd like to unit test a service, however, when running the test, I get the following error: Uncaught (in promise) SyntaxError: Unexpected token o in JSON at position 1 at MapSubscriber....

Error while running 'tns doctor'

I have successfully completed the setup for nativescript without getting any errors or issues. But when I test my install for nativescript using tns doctor I am getting an error something like this.

Failed to load template from assets folder on iOs. Angular 2, Ionic 2

I have an app on Ionic 2 framework. I need it for my needs to load template from assets folder. In my case it's emptypage.html. @Component({ templateUrl: 'assets/emptypage.html' }) export ...

Angular 2 build giving 404 error while reloading the page

After build i moved to node server and try to execute there it working but when reloading it's gives error like "Cannot GET /login import {Routes,RouterModule}from '@angular/router'; import {...

How modify CSS of ng-bootstrap carousel using Angular 2

recently, I have tried to modify the class "carousel-item" inside ng-bootstrap carousel component. However, I found that I need to add "encapsulation: ViewEncapsulation.None" in the metadata. Using ...

Angularjs 2 show hide based on index

I want to show hide div based on index template <tbody> <tr *ngFor="#item of itemList; #i = index"> <td class="text-center">{{i+1}}</td> <td class="...

Parent function return undefined in child component - angular2

I am new in Angular 2 so please be lenient. I want to use function (declared in parent component) in child component. I am using @output. This function should return some string, and child need to ...

Observable returns results to the last-subscriber only -angular2

setupService and locationService are returning observables, but both data is caught in the subscriber function of the second call that is this.locationService.getData(). Why is this so? If I call the ...

Angular 4 submit form errors

I have several problems with my form. It has been designed to be a search tool. 1 input, 1 button and here we go. But something is not right. I use an API, when you send a string to it, it brings you ...

Scaling Angular to large number of components

I'm currently using Angular (v4) to build a web app which is essentially a portfolio of work. Each entry into the portfolio will most likely require its own component. Here lies the issue, the number ...

Error using nativescript `tns run android`

I am very new to nativescript and just starting up a new project using nativescript. I am trying to run nativescript starter template using tns run android and its showing error saying The ...

angular 2 lazy loading of chunks with webpack

I have a simple angular2-cli project which uses webpack and I want to use the angular lazy loading feature to load modules. The following works fine: { path: 'users', loadChildren: 'app/...

Angular 2 : Unexpected token { in JSON at position 2

I am new to angualr 2 and getting error when i convert xml to json using xml2json library i ahve attached dataservice and xml file for reference below is my error when i load local xml file host ...

Angular 2 AOT error when serving

I'm trying to follow the Ahead-of-time guide found here. I have managed to get it to compile without errors, but when I try to serve the app with "lite-server", I'm getting the error : Uncaught ...

Angular 2 app does not run on IIS server

I have an Angular 2 app that is running properly when I do ng-serve, however when I migrate it to IIS, its not working properly, its stuck on the loading....screen. I am pointing my folder to root ...

ERROR TypeError: Cannot read property 'value' of undefined

Please i am new to Angular and i am following a tutorial by Felipe Coury. in a chapter of the book(writing your first angular 2 web application), He uses ".value" to display the title and the link in ...

Angular 2: cross browser detection of click outside of component (shadow dom)

I am using a component from another library in my Angular2 application. My goal is to implement a cross browser detection of a mouse click outside of this component. I implemented two strategies, ...

while loop is not waiting till the function execution

I'm trying to loop the objects inside while loop but i'm unable to get the result.. here is my test.ts _i: number = 0; barcode(index, pickuplist) { BarcodeScanner.scan().then((barcodeData) =>...

Angular 4 and Ionic 3 No provider for HTTP

I have a service which imports Http, and when I use it in my app it throws error. "No provider for Http! Error at g injectionError". I am lazyloading the app. Also the provider was generated through ...

Angular 2 post request not send image data

I'm sending an image using a form and when it does the submit send the request without data. Here my code: component.html <form [formGroup]="logoImageForm" *ngIf="representativeSelected != null" (...

ngx-popover cannot read 'show' of undefined

I am using ngx-popover, when try to open it from another component it was showing the following error Cannot read property 'show' of undefined below is the following code. In home.html <span (...

Typescript How to reference a static attribute of a class in a const variable

I'm dealing with a strange situation, at least for me. In my angular 2 project, in a typescript module I tried to replace the hardcoded routes showed below: const routes: Routes = [ { path: '', ...

angular-cli and scss being inlined

I think i must be missing something very simple here. Fresh install of angular-cli, create a new site with scss. Fill in the scss in the global style.scss and also some in a component scss. when ...

Prevent native navigation bar in browsers on phones (iPhone) from popping up when scrolling

I want my Angular2 application to prevent the default navigation bar from popping up when you scroll on the web-page, or if you press the lower part or upper part of the screen. I have attached an ...

How to reproduce some simple css/javascript animations on Angular

Before using Angular 2+, I often used some animations in pure javascript/css. An example is a basic badge animation on number update as it can be shown on this codepen. Using this javascript code: (...

Execute multiple third party api calls using AngularJS and Asp.Net Core Web Api

I have an AngularJS application with Asp.Net Core Web API as back-end server support. There is a situation to call multiple third party API calls from Asp.Net Web API (CORS is not enabled on that ...

Angular2 App not correct initialize on browser refresh

While developing first Angular2 app I stumble on a problem when app is refreshed in browser. To use app, user need to be authentificate. I have authenticationService which handle this, and when user ...

Is it a good practice to use getter setter in angular 2 application

I am working on angular2 application in which my team member are using getter and setter to set input properties as follow private _showModal; @Input() set showModal(showModal){ this._showModal ...

What is a proper way to handle errors from Node js to Angular 2?

I have a simple task. Lets say, that user can add a news in a form which has two fields, title and content. Title field must be filled. I can check it on client side but also on server side, for ...

How to watch from directive on a simple variable changes inside a service?

I have a simple service with data variable: import { Injectable } from '@angular/core'; @Injectable() export class MyService { private _data:number; get data(): number { return this._data; ...

Modal Pop up in Angular2

I have a modal in HTML code like as mentioned below. <app-modal #modal1> <div class="app-modal-header"> header </div> ...

prime-ng datatable: how to use Globalfilter with ng-template tag in p-column

CONTEXT I use Prime-ng Datatable module in my Angular project. I have 7 columns like shown below in my datatable. The data shows very well in browser PROBLEM I can't use [globalFilter]. When I try ...

Angular2 Shared Module

I have a question. I have some components that I want to be able to added all over my application. I don't to load all this components from the beggining but on demand (lazy loading). For example I ...
Translating... 0%