All Questions

134
votes
3answers
74055 views

Angular 2 dynamic tabs with user-click chosen components

I'm trying to setup a tab system that allows for components to register themselves (with a title). The first tab is like an inbox, there's plenty of actions/link items to choose from for the users, an...
21
votes
4answers
4979 views

How do I return the response from an Observable/http/async call in angular2?

I have service which returns an observable which does an http request to my server and gets the data. I want to use this data but I always end up getting undefined. What's the problem? Service: @Inj...
158
votes
18answers
45663 views

What is the correct way to share the result of an Angular Http network call in RxJs 5?

By using Http, we call a method that does a network call and returns an http observable: getCustomer() { return this.http.get('/someUrl').map(res => res.json()); } If we take this observable...
102
votes
9answers
72644 views

How can I use/create dynamic template to compile dynamic Component with Angular 2.0?

I want to dynamically create template. This should be used to build a ComponentType at Runtime and place (even replace) it somewhere inside of the hosting Component. Until RC4 I was using ComponentR...
114
votes
24answers
73927 views

Angular 2.0 router not working on reloading the browser

I am using Angular 2.0.0-alpha.30 version. When redirect to a different route, then refresh the browser , its showing Cannot GET /route. Can you help me with figuring why this error happened.
234
votes
9answers
242307 views

How can I select an element in a component template?

Does anybody know how to get hold of an element defined in a component template? Polymer makes it really easy with the $ and $$. I was just wondering how to go about it in Angular 2. Take the exampl...
41
votes
1answers
23918 views

In RC.1 some styles can't be added using binding syntax

Styles like <div [style.background-image]="\'url(\' + image + \')\'">Background</div> <div [style.transform]="rotate(7deg)" are not added anymore
132
votes
6answers
71644 views

Delegation: EventEmitter or Observable in Angular

I am trying to implement something like a delegation pattern in Angular. When the user clicks on a nav-item, I would like to call a function which then emits an event which should in turn be handled ...
338
votes
15answers
192632 views

Angular HTML binding

I am writing an Angular application, and I have an HTML response I want to display. How do I do that? If I simply use the binding syntax {{myVal}} it encodes all HTML characters (of course). I need s...
85
votes
8answers
38532 views

Equivalent of $compile in Angular 2

I want to manually compile some HTML containing directives. What is the equivalent of $compile in Angular 2? For example, in Angular 1, I could dynamically compile a fragment of HTML and append it t...

Previous Next