0

I was writing a sample app to display a set of youtube videos using AngularJS and filtering the videos based on language. I am binding user action to ngFilter and hiding and displaying filter based on that.

Please see JS Fiddle for code ==> http://jsfiddle.net/saratchandramrs/kxk9p/

If the ideal place to put the DOM manipulation code is on the directive per this AngularJS post - click here

Should I be doing something with the directives in my example? or would it be a overkill or could someone help me understand if I am doing it right per AngularJS principles? or if there is a better way to do what I am doing?

Also, every time the filter value changes, the DOM reloads, is there a way we can accomplish this functionality with out the reload? or is it like hiding individual elements based on the filter value (similar to css style:"display:none")?

Side note: I am using Bootstrap 3 for UI styling.

Thanks for the guidance.

Community
  • 1
  • 1
Satya
  • 1,037
  • 3
  • 15
  • 34

1 Answers1

1

The problem with performance is that you load a iframe for youtube in the directive. Every time you filter, load data form youtube. Did you see http://devgirl.org/2013/03/21/fun-with-angularjs/ ?

evoratec
  • 59
  • 1
  • 3
  • Thanks much for the link. I read through it and the effort was similar to mine in a way. – Satya Nov 21 '13 at 20:47