Skip to content

Instantly share code, notes, and snippets.

@shirazz
Created May 24, 2017 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shirazz/7dd05b3f0f9315cde7d5046ff6f4974c to your computer and use it in GitHub Desktop.
Save shirazz/7dd05b3f0f9315cde7d5046ff6f4974c to your computer and use it in GitHub Desktop.
html(lang="en", ng-app='test', ng-strict-di)
head
title(ng-bind="tfMetaTags.title")
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0")
meta(name="fragment", content="!")
meta(ng-repeat="(key, value) in tfMetaTags.properties", name="{{key}}", content="{{value}}")
base(href="/")
.state('products.product', {
url: '/',
views: {
content: {
templateUrl: 'product.html',
controller: 'ProductCtrl'
}
},
resolve: {
/* @ngInject */
movieData: function($q, $timeout) {
var deferred = $q.defer();
$timeout(function() {
deferred.resolve({
title: 'The Lord of the Rings: The Fellowship of the Ring',
year: 2001,
summary: 'A meek hobbit of the Shire and eight companions set out on a journey to Mount Doom to destroy the One Ring and the dark lord Sauron.'
});
}, 1000);
return deferred.promise;
}
},
tfMetaTags: {
/* @ngInject */
title: function(movieData) {
return movieData.title;
},
properties: {
description: 'Summary: {{movieData.summary}}; Year: {{movieData.year}}'
}
}
})
<title data-ng-bind="tfMetaTags.title" class="ng-binding">movieData,function title(movieData) { return movieData.title} </title>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment