Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. var Table = function($elem) {
  2. this.PROPERTIE.element = $elem;
  3.  
  4. this.init();
  5. };
  6.  
  7. Table.prototype.PROPERTIE = {
  8. secondElement: $('.second') // this exists in the HTML
  9. };
  10.  
  11. Table.prototype.init = function() {
  12. console.log(this.PROPERTIE.element) -> output the element;
  13. console.log(this.PROPERTIE.secondElement) -> undefined
  14. };
  15.  
  16.  
  17. var tableDirective = function() {
  18. return {
  19. restrict: 'M',
  20. link: function($scope, $elem) {
  21. return new Table($elem);
  22. }
  23. };
  24. };
  25.  
  26. angular.module('app').directive('tableDirective', tableDirective);
  27.  
  28. link: function($scope, $elem) {
  29. $elem.ready( function(){
  30. new Table($elem)
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement