Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4883e95

Browse files
ivomjuNarretz
authored andcommitted
refactor(*): move noop functions to angular.noop
Closes #14151
1 parent 9c7c494 commit 4883e95

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ng/animate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function prepareAnimateOptions(options) {
5454
}
5555

5656
var $$CoreAnimateJsProvider = function() {
57-
this.$get = function() {};
57+
this.$get = noop;
5858
};
5959

6060
// this is prefixed with Core since it conflicts with

src/ng/compile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
10751075
* See also {@link ng.$compileProvider#directive $compileProvider.directive()}.
10761076
*/
10771077
this.component = function registerComponent(name, options) {
1078-
var controller = options.controller || function() {};
1078+
var controller = options.controller || noop;
10791079

10801080
function factory($injector) {
10811081
function makeInjectable(fn) {

src/ng/parse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ ASTInterpreter.prototype = {
13141314
forEach(ast.body, function(expression) {
13151315
expressions.push(self.recurse(expression.expression));
13161316
});
1317-
var fn = ast.body.length === 0 ? function() {} :
1317+
var fn = ast.body.length === 0 ? noop :
13181318
ast.body.length === 1 ? expressions[0] :
13191319
function(scope, locals) {
13201320
var lastValue;

0 commit comments

Comments
 (0)