Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Table = function($elem) {
- this.PROPERTIE.element = $elem;
- this.init();
- };
- Table.prototype.PROPERTIE = {
- secondElement: $('.second') // this exists in the HTML
- };
- Table.prototype.init = function() {
- console.log(this.PROPERTIE.element) -> output the element;
- console.log(this.PROPERTIE.secondElement) -> undefined
- };
- var tableDirective = function() {
- return {
- restrict: 'M',
- link: function($scope, $elem) {
- return new Table($elem);
- }
- };
- };
- angular.module('app').directive('tableDirective', tableDirective);
- link: function($scope, $elem) {
- $elem.ready( function(){
- new Table($elem)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement