My target is to send data from Angular component to service and use service methods to work on it. Example:  export class SomeComponent {     public data: Array<any> = MyData;     public constructor(private myService: MyService) {       this.my...
This is in continuation of the previous question I asked on SO: Add directives to component selector when it is declared - Angular 7  I am dynamically creating components on a button click. The components are displayed one below another in a list lik...
I have a strange problem where by the form submit event of my child form is firing twice on my parent form.  child.component.html  <form [formGroup]="childForm" (ngSubmit)="childFormSubmit()">   ... </form>   child.compone...
Taken from the AngularJS 1 documentation:     You can also make the binding optional by adding ? : <? or <?attr.   How does the optional one differ from the non-optional one for the one-way binding?  I can seem to figure out the differences for...
I am new to Angular and am running into an issue with the constructor on a child component being called twice, and the second time it is called it is clearing the properties set the first time.  This is the parent component:  @Component({     selecto...
Error     compiler.js:215 Uncaught Error: Template parse errors:   Can't bind to 'ngbCollapse' since it isn't a known property of 'div'. ("][ngbCollapse]="isHidden">   I have a NavbarComponent and a FooterCompon...
I have piece of html I want to show as a component, as I'm not manipulating the DOM.  As a directive it works fine, but as a component it doesn't. I have made components before with no problem, just can't see what the issue is here. If I...
Is there a difference between using Controller1 vs Controller2?    angular.module('app', []) .component('foo', {     templateUrl: 'foo.html',     bindings: {         user: '<',     },     controller: Controller1, //...
I have a component unit test which isn't handling a promise rejection from a mock in the way I expected it to.  I have this function on a component which sends some data to addUserToOrganisation and handles the Promise that it returns:   public o...
The only way I know of being able to use my directive is by exporting it in the module.  @NgModule({   imports: [     CommonModule   ],   declarations: [BreadcrumbsComponent, IsRightDirective],   exports: [BreadcrumbsComponent, IsRightDirective] }) e...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.