add `getTitle` method to `meta.service`
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] bug report => check the README and search github for a similar issue or PR before submitting
[ ] support request => check the README and search github for a similar issue or PR before submitting
[x] feature request
Current behavior
There’s no interface which allows to retrieve the current page title using meta.service
.
Expected/desired behavior
metaService.getTitle
method should be introduced, and should return the current page title:
- with callback
- without callback
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
The page title needs to be used on different parts of the corresponding page. There’re such scenarios where we need to supply this value to ngrx
, etc.
Please tell us about your environment:
- Angular version: 2.0.X
- 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 ]
-
Language: [all | TypeScript X.X | ES6/7 | ES5]
-
Node (for AoT issues):
node --version
=
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to Set Dynamic Page Title and Meta Tags in Angular 6 ...
In title service availables method are setTitle() and getTitle() ... Meta tag service that can be used to get and add meta tags...
Read more >php - Getting title and meta tags from external website
Here's a little function which is a bit more usable in 2018. It tries to get OG tags and falls back to meta...
Read more >Route, set meta title in controller - Drupal Answers
I have a route that takes data from APIs, so I would like to set the title in the controller and not in...
Read more >Class PageMetaData
Returns all page meta tags added to this container. getTitle() : String. Returns the page's title. isPageMetaTagSet ...
Read more >Set Page Title Using Title Service Angular Example
The title service provides only two methods. SetTitle & GetTitle . We use SetTitle to set the title of the page and GetTitle...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
needing this too, would be awesome to have.
Another use case: I have a title component that sits at the top of the mobile version of my site. I have the translation service that sets the title dynamically. Would be nice to able to display that value on this component. I guess I will need to find another way.
EDIT: I am now just using
this.meta['title'].getTitle()