apparentlymart / angularjs-viewhead Goto Github PK
View Code? Open in Web Editor NEWChange the HTML title and head elements on a per-view basis
Home Page: http://apparentlymart.github.io/angularjs-viewhead/example/
License: MIT License
Change the HTML title and head elements on a per-view basis
Home Page: http://apparentlymart.github.io/angularjs-viewhead/example/
License: MIT License
... is there a better solution out there to deal with meta tags in AngularJS?
please provide a minified version
When using ui-sref
for navigating to another ui-view
, the $rootScope.viewTitle
is deleted before it can be set by the view-title
in the destination view.
This causes a flicker in the window title (in Chrome) and, worse, the incorrect title shows
up in the browser history.
http://plnkr.co/edit/3KFIrSyqreBdYxTHQd2M?p=info
I fixed this by delaying the delete $rootScope.viewTitle
until the next digest cycle and only delete the viewTitle if it hasn't be re-assigned by some other <view-title>
directive.
Hello,
I apologize for creating an issue for this, but I couldn't figure out another way to contact you. I see in the example a dynamic og metatag, but I don't understand how this could be. Facebook interprets these tags without executing javascript, so how would Facebook be able to interpret this? My goal is to have dynamic metatags on Facebook / Twitter / Google without having to create a pre-render server and all that headache.
Thanks very much,
-Keith Chima
Every main view of my application has a view-title, but some have to wait for an AJAX call to come back
For example
"UserX - myApp"
when I go to UserY, the view title vanishes, so the default html title will be displayed which is the URL.
Then when the user is loaded, the ng-if will be rendered and just then the title shows "UserY - myApp"
Removing delete $rootScope.viewTitle
fixed it for me
Package can not be found in NPM registry:
https://www.npmjs.com/search?q=viewhead
Can I use the view head like this?
Can we document using: <title view-head></title>
from a template in addition to the documentation for <view-head></view-head>
?
It seems <view-head>
only works when the ng-app
directive is on the <html>
element which is incompatible with preboot (ng-app needs to be on a <div>
within <body>
)
I've made some changes to your repo to:
If I could push my branch for a review that'd be great. Everything works exactly the same but allows for more flexibility now. Just waiting on your permission to push my new branch (pulled from master).
I am trying to load dynamic content into the meta tags for facebook share button. The state loads with the tags transported to the head, but the dynamic content is blank. My tags look similar to the below.
<meta view-head property="og:url" content="{{share.url}}" />
<meta view-head property="og:title" content="{{share.title}}" />
<meta view-head property="og:image" content="{{share.image}}" />
<meta view-head property="og:description" content="{{share.desc}}" />
<meta view-head property="og:image:height" content="{{share.imgh}}" />
<meta view-head property="og:image:width" content="{{share.imgw}}" />
I am using angular-ui/ui-router (https://github.com/angular-ui/ui-router). The 'destroy' action of the directive occurs prior to ui-router registering the name in the history stack. Therefore, you cannot see the titles in this browser history. I have solved the issue in my project via a workaround. However, the workaround it is not as clean or modular as I would prefer, so I am not going to submit a pull request with it. I did, however, think I should report the issue, in case you can come up with a clean way of handling the issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.