Answer the question
In order to leave comments, you need to log in
How to write named function in coffeeScript?
Tell me what's wrong when I try to write a regular named function in coffeeScript and compile it with gulp and I don't get exactly what I need
. Sources and examples
app = angular.module "myApp2", []
app.controller("myController", ($scope, $http, $q)->
init () -> console.log "hello coffee"
)
var app;
app = angular.module("myApp2", []);
app.controller("myController", function($scope, $http, $q) {
return init(function() {
return console.log("hello coffee");
});
});
var app = angular.module("myApp2", []);
app.controller("myController", function ($scope, $http, $q) {
function init() {
console.log("hello coffee");
}
});
Answer the question
In order to leave comments, you need to log in
Will not work. The closest analogue
app = angular.module "myApp2", []
app.controller "myController", ($scope, $http, $q)->
init = ->
console.log "hello coffee";
return
return
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question