AngularJS: How to run additional code after AngularJS has rendered a template?

I have an Angular template in the DOM. When my controller gets new data from a service, it updates the model in the $scope, and re-renders the template. All good so far. The issue is that I need...

Angular2 - should private variables be accessible in the template?

If a variable is declared private on a component class, should I be able to access it in the template of that component? @Component({ selector: 'my-app', template: ` <div> ...

Angular: conditional class with *ngClass

What is wrong with my Angular code? I am getting the following error: Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass <ol> <li *ngClass="{active: step==='step1'}"...

Problems with Angular 2 Http GET

I'm struggling to do a http get request with Angular 2. I've made a file with the JSON information that I want to "get" with my TeacherInfo class and use it to display information by the account...

CUSTOM_ELEMENTS_SCHEMA added to NgModule.schemas still showing Error

I just upgraded from Angular 2 rc4 to rc6 and having troubles doing so. I see the following error on my console: Unhandled Promise rejection: Template parse errors: 'cl-header' is not a known...

Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays

I looked at similar questions, but none of them helped me. I am going to receive an object like the following: [ { "id": 1, "name": "Safa", "email": "[email protected]", ...

Wrapping content children in a dynamic parent tag with Angular 2

What I want to do I want to create a reusable Angular 2 button component that may render as an <a /> tag or an <input /> tag depending on an input to the component called type. I want the button...

Angular 2 - How to use prerender.io along with lazy loading

Since Angular Universal isn't going to be in the CLI for quite a while I must use prerender.io to allow SEO to work properly. However, after some tests it appears that it doesn't work all that...

angular2 ngFor not working while fetching data from api on ngOnInit()

comment.component.ts: import { Component, OnInit } from '@angular/core'; import { Router} from '@angular/router' import { Comment } from 'comment entity path' import {CommentService} from 'comment...

ionic3, differences between NavController and Nav, from package 'ionic-angular'

in ionic doc link i have NavController: https://ionicframework.com/docs/api/navigation/NavController/ import { Component, ViewChild } from '@angular/core'; import { NavController } from...

Angular 2 two way data binding not working

I'm having trouble getting custom two way data binding to work in Angular 2. The Docs indicate that the banana in a box model - [()] is just syntatic sugar, however in my example this way doesn't...

touched and valid using reactive forms in Angular

How can i use the touched and valid properties using reactive forms in angular 4. I've used in template driven forms and you can just put this <span class="text-muted" *ngIf="!fname.valid &&...

Angular/Chart.js error: Failed to create chart: can't acquire context from the given item

This is really my first time using Chart.js and I am importing it into an Angular component. I am trying to at this point just create a simple bar chart. I am getting the following error in my...

Angular 4+ bootstrap NgbAccordion how to expand / collapse all

I've been playing around with angular in combination with ng-bootstrap and I am stumped about the following: I have this NgbAccordion on my page: <ngb-accordion #acc="ngbAccordion"> <ngb-panel...

Error: Schema validation failed with the following errors: Data path "" should NOT have additional properties(project)

After migrating application from angular 5 to 6, on running ng serve the following errors pop up. Schema validation failed with the following errors: Data path "" should NOT have additional...

ag-grid and angular, how to switch grid options dynamically

I have two different grid configurations (represented as two gridOption objects). One is loading local data, where the other one is using an elasticsearch datasource with the infinite row...

npm install stuck at extract: zone.js

I am not an expert on JS so this problem might have an easy solution. I am trying out .Net Core Angular SPA template. When I try to run npm install command, it gets stuck on extract:zone.js step....

New line in Angular Notifier

As I cannot find a decision for this, here is a simple question for Angular 6. I am using angular 6 with angular-notofier service and I am trying to show a simple multiline message for the user. I...

ERROR in : The pipe 'translate' could not be found

I am using Angular 7.1 but unfortunately I am not able to make the translate pipe of ngx-translate to work… package.json "dependencies": { "@angular/animations": "~7.1.0", ...

How to reset validation error without resetting form in angular?

I have an angular template driven form. and I want to reset all the validation error and make it as untouched without resetting the form. How to do that in angular? I have tried the following...

renderComponent in Angular ivy with extra component/directive declarations

Here is an example of render dynamic lazy component in ivy: import { ɵrenderComponent as renderComponent, Injector } from '@angular/core'; @Component({ selector: 'app-root', template: ` ...

Why doesn't async pipe detect changes in Angular (but subscription in component.ts does)?

I'm using an async pipe in angular to monitor an observable coming from an rxjs store. The component's ngOnInit looks like this ngOnInit() { this.userRole$ =...

core.js:6406 ERROR TypeError: Cannot read property 'id' of undefined

I have an angular 8 application. And a create function. But I can't create a item, because of the id is null. Of course I googled for this. But I think this is a specific case. So this is the the...

Angular 9 decorators on abstract base class

I'm working on upgrading my project from Angular 8 to 9, and I've come across a problem with new requirements when extending classes. According to Angular's documentation: Undecorated base...

Angular 12 - Generating browser application bundles (phase: sealing) very slow

After I update my Angular Application from Angular 11.2.12 to Angular 12.0.0 Angular CLI: 12.0.0 Node: 14.15.4 Package Manager: npm 6.14.10 OS: win32 x64 Angular: undefined ... Package ...

How to fix: "@angular/fire"' has no exported member 'AngularFireModule'.ts(2305) ionic, firebase, angular

I'm trying to connect my app with a firebase db, but I receive 4 error messages on app.module.ts: '"@angular/fire"' has no exported member 'AngularFireModule'.ts(2305), '"@angular/fire/storage"'...

VS 2022 ASP.Net Angular - File Not Found Errors

I created a new ASP.Net Core Angular project in Visual Studio 2022 using the VS new template. Once I built the application the first time which in its turn runs npm install I see errors under the...

Static files are NotFound in ASP NET 6 with Angular 12 and IndividualAccounts Visual Studio template

We have a project that has been started 5 years ago in ASP .NET MVC 4. When DOTNET Core was released, we migrated the entire application in the Visual Studio with Angular template. Since at that...

Angular v13 Jest with nx test - SyntaxError: Cannot use import statement outside a module at Runtime.createScriptFromCode

I tried to follow every comment with a possible solution here to the letter. I relied on an example project on github as well which works perfectly. This also started to happen to me after...

Angular 8 ERROR Error: Unable to find context associated with [object HTMLDivElement]

Just another day in the office, right? What once worked is no longer working. Yay! I am supporting an Angular 8 web application and attempting to kickstart localhost:4200. That said, the following...