-
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
refreshing page doesn't set the title or description that's defined in the router #28
Comments
I can see the same issue in the deprecated ng2-metadata repo, but then when you start navigating again it's not updating anything. You need to go back to the top route and then go down the tree again and it will set whatever is defined in the router. There must be something wrong with the way you listen to router events. |
Hi @chrillewoodz, there was in issue #15 which prevented the default meta settings to be rendered on views without meta settings in its route definitions. That's why the deprecated ng2-metadata does not update anything. This behavior has been changed since the rc.4 release of @nglibs/meta. However, I see that we need to make improvisations. I'll analyze this issue as well as #27 at a first available time, and then let you know about details. Meanwhile, any further inspections and issues reported are highly appreciated. Thank you. |
Hi @chrillewoodz, 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 about banana page<br/>
If your life sucks, start a new one in Banana Republic`
})
export class AboutBananaComponent implements OnInit {
constructor(private meta: MetaService) {
}
ngOnInit(): void {
this.meta.setTitle('Today the lucky person is: bjornharvold'); // as promised
}
} Just after the initial navigation, the output (page title) was exactly: Then, I clicked on the link And finally, I pressed Again, based on the information you provided, I could not reproduce the issue - 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, you see, I mentioned you too 😄 |
Than you for the mention @fulls1z3 ;-) The problem I was having was not setting it directly but like this: My current code:
Unless I add "false, false" the title doesn't update |
Hi @bjornharvold, now with this repro steps I can have a better understanding about the issue, thank you for the provided information 👍 A similar topic was just discussed on #30: without There's a subscription bound to the event, true. But it cannot be triggered just because I'm thinking about possibilities without listening to On the other hand, this issue reveals the fact that I need to document the behavior of So, I want to say my thanks again to @chrillewoodz @cybey and @bjornharvold for all your contributions. |
I'm submitting a ... (check one with "x")
Current behavior
If I go from page 1 to page 2, the metas are set correctly, but if I go from page 1 to page 2 and then refresh on page 2, page 2's metas aren't being set.
Expected/desired behavior
I expect the page 2's metas to be set on refresh as well.
Minimal reproduction of the problem with instructions
See current behavior.
Angular version: 2.0.X
2.3.1
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: