2 ms·
Never had this problem with coffeescript until... today. Some hours after I read this post. Thanks angular.module("blabla", []).directive "bla", -> template:
by standup75 13y ago
Never had this problem with coffeescript until... today. Some hours after I read this post. Thanks
angular.module("blabla", []).directive "bla", ->
template: """
<div>Whatever<div ng-transclude></div></div></div>
"""
scope: true
transclude: true
restrict: "E"
compile: (element, attributes) ->
$input = element.find "input"
for attr, value of attributes.$attr
$input.attr value, attributes[attr]
element[0].removeAttribute value
(scope, element, attributes) ->
$input = element.find "input"
# do something with $input
# now $input is global to all directive and that sucks
- saraid216 13y agoDrop a "space space" in front of every line in your code and it'll format monospace.