Skip to content

Commit 77f0a6d

Browse files
committed
Merge branch 'develop'
2 parents f039cfc + 7dec9b5 commit 77f0a6d

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

angular-classy.coffee

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ classFns =
7979
$scope = parent[parent.constructor::__options._scopeName]
8080
for key, fn of parent.constructor::
8181
continue unless angular.isFunction(fn)
82-
continue if key in ['constructor', 'init', 'watch'] or key[0] is '_'
83-
$scope[key] = angular.bind(parent, fn)
82+
continue if key in ['constructor', 'init', 'watch']
83+
parent[key] = angular.bind(parent, fn)
84+
if key[0] isnt '_'
85+
$scope[key] = parent[key]
8486

8587
bindDependencies: (parent, args) ->
8688
injectObject = parent.__classyControllerInjectObject
@@ -184,4 +186,4 @@ classFns =
184186
if angular.isArray(deps) then @inject(parent, deps)
185187

186188
# If `deps` is object: Wrap object in array and then inject
187-
else if angular.isObject(deps) then @inject(parent, [deps])
189+
else if angular.isObject(deps) then @inject(parent, [deps])

angular-classy.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,15 @@ License: MIT
100100
if (!angular.isFunction(fn)) {
101101
continue;
102102
}
103-
if ((key === 'constructor' || key === 'init' || key === 'watch') || key[0] === '_') {
103+
if (key === 'constructor' || key === 'init' || key === 'watch') {
104104
continue;
105105
}
106-
_results.push($scope[key] = angular.bind(parent, fn));
106+
parent[key] = angular.bind(parent, fn);
107+
if (key[0] !== '_') {
108+
_results.push($scope[key] = parent[key]);
109+
} else {
110+
_results.push(void 0);
111+
}
107112
}
108113
return _results;
109114
},

angular-classy.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)