Skip to content

Instantly share code, notes, and snippets.

@chaosim
chaosim / index.coffee
Last active December 25, 2015 01:19
why can not find required controller?
module.directive('foo', [
'$log', function($log) {
return {
restrict: 'E',
replace: true,
transclude: true,
template: '<div id="test" ng-transclude></div>',
controller: function($scope) {
this.scope = $scope;
@chaosim
chaosim / gruntfile.coffee
Created October 8, 2013 09:29
watch and run tasks only on changed files
grunt.event.on 'watch', (action, filepath, target) ->
if minimatch filepath, 'src/**/*.coffee'
grunt.config.set 'coffee',
dev:
expand: true
cwd: 'src'
src: filepath.slice(4)
dest: 'dev'
ext: '.js'
else if minimatch filepath, 'src/views/**/*.jade'