Make page title a value from database in angular uirouter?


Hello there meteor forum

I’m creating an FAQ. I’m trying to make it SEO friendly so if someone types a question related to my app I would like it to appear in the search result.

I’m trying to make the title be dynamically with the value from the database but I’ve failed to achieve it.

I got it somewhat working but it doesn’t get the current title, it just takes the old one from the previous visited state and not the one currently visiting.

My question would be.

How do I make a FAQ section SEO friendly on angular-meteor?



I don’t know uirouter, but I do this in an app I made:



    pageTitle: function(){
        return Session.get("pageTitle");

in the router:

onAfterAction: function(){
            case "/path1":
                Session.set("pageTitle", "Frank");
            case "/path2":
                Session.set("pageTitle", "Zappa");

that function could of course be:

onAfterAction: function(){
     MyTitles.findOne({path: Router.current().route.path()})

if you want to use a db