user1538814
user1538814

Reputation: 211

angularjs "hello world" directive + coffeescript not working

assume I have my directives in

@directivesModule = angular.module('myApp.directives', [])

and in directive.coffee

directivesModule.directive 'showAuthorLogin', () ->
    restrict: 'E'
    template: '<div>Hello World</div>'

index.html:

<span showAuthorLogin></span>

why isn't anything showing?

Upvotes: 0

Views: 88

Answers (1)

rob
rob

Reputation: 18513

restrict: 'E' means that the directive has to be an element. So you could change the directive to restrict: 'A' or you could change your html to: <showAuthorLogin></showAuthorLogin>

Here is an example of it working on JSFiddle: http://jsfiddle.net/X6A7M/

Upvotes: 1

Related Questions