question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add `getTitle` method to `meta.service`

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
stewonescommented, May 7, 2018

needing this too, would be awesome to have.

0reactions
logan-jobzmallcommented, Dec 20, 2018

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()

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found