Skip to content

Instantly share code, notes, and snippets.

@djadriano
Created October 3, 2013 03:00
Show Gist options
  • Save djadriano/6804116 to your computer and use it in GitHub Desktop.
Save djadriano/6804116 to your computer and use it in GitHub Desktop.
lightbox angularjs directive
EurodanceApp.directive('modal', function($compile){
var template = '<h2>{{title}}</h2><p>{{content}}</p>';
return {
restrict : 'A',
scope : true,
link : function( scope, element, attrs ) {
scope.title = attrs.title;
scope.content = 'conteudo do lightbox';
var new_template = $compile( template )( scope );
element.append( new_template );
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment