javascript - attribute directive on title tag in IE8 does not run -


& lt; Title & gt; See under the super-simple instructions attached to the tag, activates it in the modern browsers and converts the title to "title C", but the link function in IE8 is never called and the title "Title B " lives.

Directive attributes should be & lt; Title & gt; in the corner in a cross-browser manner I have other ideas for updating the tag title value, but I'm looking for some certainty whether the glass supports it or not.

  & lt ;; Doctype html & gt; & Lt; html xmlns: ng = "http://angularjs.org" id = "ng-ap" ng-app = "ip"> gt; & Lt; Top & gt; & Lt; Title Update-Title & gt; Title A & lt; / Title & gt; & Lt; script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; Body & lt; Script & gt; Window.document.title = "Title B"; Angular Module ('myApp', []). Directive ('updateTitle', ['$ window', function ($ window)) {return {restrict: 'a', scope: {}, link: function (area, element) {$ window.document.title = "title C";}};}]); & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

This is a strange problem. I can not tell a logical reason why that instruction is not Is running.

However, the following is the function of the title tag in IE8, depending on the way your instruction is typed:

  & lt ;; Doctype html & gt; & Lt; html xmlns: ng = "http://angularjs.org" id = "ng-app" ng-app = "mypad" & gt; & Lt; Head Update-Title & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; Body content & lt; script src = "http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; Window.document.title = "Title B"; Angular Module ('myApp', []). Directive ('updateTitle', ['$ window', function ($ window)) {return {restrict: 'a', scope: {}, link: function (area, element) {$ window.document.title = "title C";}};}]); & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

I am not an fingerprint master, but it does not seem that the proper use of the instruction is. According to the docs:

At the higher level, instructions are markers on a DOM element (such as an attribute, element name, comment, or CSS class), which are the AngularJS HTML compiler ($ compilation) that DOM To attach a specific behavior to the element or even change the DOM element and its children.

Since only one document can have a title tag, and the title is being set without DOM element (i.e. window.document.title ) Probably would be best without instructions. Maybe through a controller? I advise some Google to find common ways to handle page titles in AIGULAR.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -