Tuesday, May 15, 2012

Custom Components: Part 2

This video expands on "Part 1" of the component video tutorial by adding the ability to toggle between an "edit mode" and a "preview mode" in your Markdown component.

Key Takeaways

  • How to use "transclusion"
  • When to use a "link function" and when to use a "compile function"
  • How to access elements inside of your component
  • The importance of isolate scope
  • Why you should always use a namespace with your components

2 comments:

  1. Thanks for the tutorial!
    Vital infos in here, maybe you get the angular crew to share this on their docs.
    That would be awesome :)

    P.S: first! ;)

    ReplyDelete
  2. Great post. I have an issue though. Why is it that when I wrap the element with a div and apply ng-repeat on top of the div, the two textareas still show up. But, when I double-click on any of the text-areas, only the word Preview is shown.

    Is there something about custom directives that doesn't play well with ng-repeat?

    ReplyDelete

Note: Only a member of this blog may post a comment.