Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Angular NYC Presentation - 3 November 2014

Angular NYC Presentation - 3 November 2014

Jaco Pretorius

November 03, 2014
Tweet

More Decks by Jaco Pretorius

Other Decks in Programming

Transcript

  1. TRANSCLUDE FUNCTION •  GIVES COMPLETE CONTROL OVER HOW THE BODY

    OF YOUR DIRECTIVE IS INSERTED INTO THE DOM •  CONTROL THE SCOPE THAT IS USED INSIDE THE BODY OF THE DIRECTIVE •  OPTIONALLY USE TRANSCLUDE: ‘ELEMENT’ INSTEAD OF TRANSCLUDE: TRUE
  2. COMMUNICATING BETWEEN DIRECTIVES •  USING THE REQUIRE PROPERTY OF YOUR

    DIRECTIVE •  CONTROLLER(S) OF THE REQUIRED DIRECTIVE(S) BECOME AVAILABLE AS THE 4TH PARAMETER IN THE LINK FUNCTION
  3. COMPILE VS LINK •  WHEN SHOULD YOU USE COMPILE? • 

    PERFORMANCE •  ANGULAR PAGE LIFE CYCLE •  ESPECIALLY USEFUL IN DIRECTIVES USING TRANSCLUDE
  4. COMPILE VS LINK STRUCTURE compile: function compile(tElement, tAttrs) { //

    interact with template element return function postLink( ... ) { ... } } // or // link: function postLink( ... ) { ... }
  5. COMPILE IN ANGULAR •  HTML ANCHOR <A /> •  FORM

    <FORM /> •  NG-BIND •  NG-CLOAK •  NG-CLICK, NG-MOUSEDOWN, NG-MOUSEUP, NG- KEYDOWN, ETC •  NG-INCLUDE