angular2-components Questions

5

Solved

I have a parent component which opens a new component on click of a link, this new component is supposed to have a close button which on close sends a closing message to parent and destroy itself...
Protolanguage asked 29/9, 2016 at 7:57

4

I am using Angular 2 to build my web application which which has lot of components. I am using angular-cli to create, run and build the project. Accidentally (or luckily) I stumbled across a bug wh...
Isleana asked 31/1, 2017 at 10:2

12

Solved

I have two components as follows and I want to call a function from another component. Both components are included in the third parent component using directive. Component 1: @component( sele...
Foxhound asked 2/6, 2016 at 9:24

4

Solved

I'm trying to figure out how I can access the selector that we pass into the @Component decorator. For example @Component({ selector: 'my-component' }) class MyComponent { constructor() { // I w...

4

Solved

Given the following code I try to test the ngOnChanges lifecycle hook of Angular2: import { it, inject, fdescribe, beforeEachProviders, } from '@angular/core/testing'; import {TestComponentBu...

3

Solved

I'm having a tough time getting modules to work in Angular 2. I have created a plunk that demonstrates the problem. In the plunk, you'll see I have app.module. This module imports app-common.module...
Civil asked 13/9, 2016 at 19:12

3

Solved

I have a text input and i'm listening for the changes. mycomponent.ts ngOnInit() { this.searchInput = new Control(); this.searchInput.valueChanges .distinctUntilChanged() .subscribe(newValue ...

2

Solved

I created a component to render SVG images that are within my app. The are loaded dynamically as the however, my demo app just show a simpler version. http://plnkr.co/edit/g2tZXeUAMJ5zESx2EHT0?p=...
Hersey asked 21/11, 2016 at 18:39

4

Solved

export interface Element { name: string; } export class Room implements Element { name: string; type:string } export class Hall implements Element { name: string; } and my varibale type is ...
Gomuti asked 31/3, 2017 at 9:12

5

Solved

I need to access to some properties of the parent DOM element which contains the component from where i want to get the info, is there a way to do such thing? Here is how my component looks like: ...
Atwood asked 21/12, 2016 at 23:2

1

I am currently learning angular and developing a small application a long the way. My application contains multiple components, some of which allowing the use to perform some crud operations....
Itchy asked 14/9, 2020 at 17:0

4

Solved

I have a considerable amount of data to show on the screen. I need to present a simplified list so the user can choose one of the items and see it's details. So imagine I have a component SimpleLi...
Whalebone asked 24/8, 2018 at 13:2

4

I just recently started diving into Angular 4 coming from Angular 1.5. I'm working with user routes and pulling API data from a service into a user component. The component seems to stay static u...
Sandhurst asked 5/5, 2017 at 13:38

3

I have been looking for some reason of this behavior, the value of a Input() property in a child component 'Param' is not been updated at the right time, I need to use the updated value to call a s...
Antipode asked 26/10, 2016 at 22:44

2

Solved

When we pass a modelto the child component and it modifies it, the values are just reflected in the child components' local variable and not available to the parent. Can we pass values by reference...
Slob asked 26/10, 2016 at 10:43

2

Solved

I have a directive that is creating in code an instance of component template he uses and set its innerHTml, which will change the tempalte dimension: var factory = this.resolver.resolveComponen...
Methylene asked 27/4, 2017 at 8:18

3

Solved

I want to create service, which can interact with one component. All another components in my app, should be able to call this service, and this service should interact with this component. How to...

2

Solved

Question I'm looking for the best approach for injecting a known/defined component into the root of an application and projecting @Input() options onto that component. Requirement This is necess...
Systematize asked 4/10, 2016 at 16:16

3

How do I get the RouteParams from a parent component as well as child routes export const routes: Routes = [ { path: '', redirectTo: 'list', pathMatch: 'full' }, { path: 'list', component: Users...
Concepcionconcept asked 10/1, 2017 at 9:10

3

Solved

I have ParentComponent and a ChildComponent, and I need to pass the ngModel in ParentComponent to ChildComponent. // the below is in ParentComponent template <child-component [(ngModel)]="value...
Olva asked 27/12, 2016 at 18:49

3

I have created an component that contains a element with a routerLink property which I want to set from a template that uses the component. When I try to do this I get the error message 'Cannot rea...
Clementinaclementine asked 5/7, 2016 at 12:40

3

Solved

Im very new to Angular 2 so bear with me. Im trying to get a new component to appear in the index.html page. The file set is from the basic quick start files from GitHub. I created a new component...
Aekerly asked 26/4, 2017 at 15:21

2

I'm try to use simple-json-loader. I install this from npm and write following function: onclickExport() { var loader = require('simple-json-loader'); var json = loader.JSONLoader.loadFromFile('...
Rosina asked 31/5, 2017 at 18:57

1

I want to call the type script function on input change of text box, and its working for me. But it call on every change, I want to call when the minimum number of character in the text box are 5. ...
Erminiaerminie asked 3/1, 2018 at 18:59

3

Solved

I'm looking for an argument on why using @Output for events is better than passing an @Input function in Angular 2+. Using @Input: Parent Template: <my-component [customEventFunction]=myFunct...

© 2022 - 2025 — McMap. All rights reserved.