Closed malthejorgensen closed 9 years ago
I am not sure how much benefit that would be since the metatags are mostly for search engines and they wouldn't normally render that specific view. For title, you could listen to stateChangeSuccess and change it there based on $state.current.data.title
or something similar.
In our specific case we are using prerender.io in order to render the Angular-driven pages to search engines and other non-javascript enabled web crawlers (the Facebook crawler). In that case changing <meta>
tags from Angular does make sense, albeit it is a special case.
The
ui-view
-directive is currently restricted to being used as an attribute, element, or style. (restrict: 'ECA'
ref) I propose that the directive should be allowed to be used as a comment as well (restrict: 'ECAM'
)That way it can be used via a named view to control the
<title>
,<meta name="description">
, and other tags in<head>
.with an exemplified state configuration
For the Angular docs see: https://code.angularjs.org/1.3.7/docs/api/ng/service/$compile#-restrict-