Thursday 25 June 2015

Angular JS Directice in IE8


  • The most powerful feature Directive in Angular JS. 
  • Allow you to create custom reusable components. 
  • Few exception are there...keep in mind..!!!
  • With IE8 Angular Js should work consistent like other browser.
  • Four ways to create directive
    1. Angular JS viz. Attribute  (Common One)
    2. Element (Common One)
    3. Class
    4. Comment
  •  Let take one example :
    • Your directive is like : <div my-js-control>....</div>
    • Now use this directive in IE8
    • Copy following syntax and paste it in your HTML/JSP page.
<Html>
    <head>

   <!--[if lte IE 8]>
      <script>
        document.createElement('div-my-js-control');
      </script>
    <![endif]-->

   </head>
</html>


  • This document.createElement() creates an element called 'my-js-control' which can use in application.
  • If you create more than one directive in your system then you need to create that many new elements for older browser
  • Long story short : It is preferable to use Angular JS directive in IE8 as attributes.




No comments:

Post a Comment