-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot set data programmatically when the string contains a variable inside a subscription method #27
Comments
I'm not sure if it's worth noting but it's inside a subscription call and it can run several times. When I do a test like this outside the subscription call it works as expected:
|
Hi @chrillewoodz, thanks for your inspections. I’ll look into this as soon as possible and then pingback on this issue my findings. |
You can solve it for now to use the function like this:
This disables the deferred part of the function |
+1 |
Hi guys, I've been working on universal (aka platform-server) integration, and seems like it will be resulted soon. Then, I'll be able to release fixes for the listed bugs together with server-side rendering support. |
Hi @chrillewoodz, @cybey, @bjornharvold, I've tested the issue documented above, using the latest version ( Without touching the default configuration (and also the // angular
import { Component, OnInit } from '@angular/core';
// libs
import { MetaService } from '@nglibs/meta';
@Component({
template: `@nglibs home page<br/>
Enjoy it!<br/>`
})
export class HomeComponent implements OnInit {
constructor(private meta: MetaService) {
}
ngOnInit(): void {
const luckyPerson = 'chrillewoodz';
this.meta.setTitle('Today, the lucky person is: ' + );
}
} The output (page title) was exactly: It worked when the Then I modified // angular
import { Component, OnInit } from '@angular/core';
// libs
import { Observable } from 'rxjs/Observable';
import { MetaService } from '@nglibs/meta';
@Component({
template: `@nglibs home page<br/>
Enjoy it!<br/>`
})
export class HomeComponent implements OnInit {
constructor(private meta: MetaService) {
}
private getTitle(): Observable<string> {
return Observable.of('cybey');
}
ngOnInit(): void {
this.getTitle().subscribe((res: string) => {
this.meta.setTitle('Today the lucky person is: ' + res);
});
}
} The output (page title) was exactly: It worked also when part of the So, I could not reproduce the issue based the information you provided - using the official showcase app @nglibs/example-app with the development environment mentioned below:
Please make sure you're using the latest version of For now, I'm closing this issue. Note: @bjornharvold, I didn't forgot you. You'll be featuring as the lucky person shown on the page title, just at the further issue 😄 |
I'm submitting a ... (check one with "x")
Current behavior
I'm doing this:
But only the
Blog -
part gets set, the rest is just gone. I've checked a number of times and the value is not null, undefined or anything like that. Because it shows fine in the template also.Expected/desired behavior
I expect the value not to be omitted.
Minimal reproduction of the problem with instructions
See current behavior.
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Angular version: 2.0.X
2.3.1 (Cannot update to latest angular as of this time because of CLI)
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
All
Language: [all | TypeScript X.X | ES6/7 | ES5]
All
Node (for AoT issues):
node --version
=6.7
The text was updated successfully, but these errors were encountered: