Skip to content
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

No substitution with grunt (angular 1.5.8) #30

Open
jonabitz opened this issue Feb 7, 2017 · 3 comments
Open

No substitution with grunt (angular 1.5.8) #30

jonabitz opened this issue Feb 7, 2017 · 3 comments

Comments

@jonabitz
Copy link

jonabitz commented Feb 7, 2017

Hi,
Have followed your steps 1-5 carefully.

Both grunt serve and build always yield the following:
<title ng-bind="ngMeta.title"></title> <meta name="description" content="{{ngMeta.description}}">

after correcting configuring and adding the preferred meta on the page in question:

    data: {
      meta: {
        'title': 'Home page',
        'description': 'This is the description'
      }
    }

In the controller have also tried the following with no effect:

ngMeta.setTitle('Demo page');
ngMeta.setDescription('This is the description of the demo page');

No errors in the console.

Hope you can help

@jonabitz
Copy link
Author

jonabitz commented Feb 7, 2017

Adding this to html template:

<pre>
Title = {{ngMeta.title | json}}
ngMeta object = {{ngMeta | json}}
</pre>

Returns the output:

Title = "Demo page"
ngMeta object = {
  "title": "Demo page",
  "description": "This is the description"
}

Because my controller was only set to:
ngMeta.setTitle('Demo page');

It seems to be replacing

  • the title with the title defined in the controller.
  • the description with the meta defined in app.js

BUT actual page meta still not updating???

@jonabitz
Copy link
Author

jonabitz commented Feb 7, 2017

uncommenting the setDescription makes things worse:

Controller:

		ngMeta.setTitle('Demo page');
		ngMeta.setDescription('This is the description of the demo page');

Output:

Title = {{ngMeta.title | json}}
ngMeta object = {{ngMeta | json}}

@jonabitz
Copy link
Author

jonabitz commented Feb 7, 2017

Not setting any meta in controller yields good output to your test but still no actual meta update...

Title = "Test Title"
ngMeta object = {
  "title": "Test Title",
  "description": "This is the description"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant