Cześć chcaiłbym was podpytać jak w angularze 2 zapiąć się na classy itp jak to wygląda? bo mam taki kod i chciałby go użyć w projekcie który tworze (na razie zrobiłem strukture, component, service i template teraz czas na magie smile.gif)

[JAVASCRIPT] pobierz, plaintext
  1. var CalcHeight = function(){
  2.  
  3. function getMaxHeight(el){
  4. var element = $(el);
  5. var height = 0;
  6. element.each(function() {
  7. if(height < $(this).height()) {
  8. height = $(this).height();
  9. }
  10. });
  11. return height;
  12. }
  13.  
  14. function setHeight(el, value){
  15. var element = $(el);
  16. element.each(function() {
  17. $(this).height(value);
  18. });
  19. }
  20.  
  21. function setParam(el, param, block){
  22. $(block).css(param, getMaxHeight(el));
  23. }
  24.  
  25. function render(el) {
  26. setHeight(el, getMaxHeight(el));
  27. }
  28.  
  29. return {
  30. getMaxHeight : getMaxHeight,
  31. setParam : setParam,
  32. init : function (el){
  33. render(el);
  34. }
  35. }
  36. }();
[JAVASCRIPT] pobierz, plaintext