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

Commit 0266a1c

Browse files
committed
refactor(compile): remove duplicate type checks
The `controller()` callback already performs the required type checks and guarantees that `controller() !== controller.instance` in the event that the function returns an explicit value.
1 parent d0f1285 commit 0266a1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ng/compile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
19671967
for (i in elementControllers) {
19681968
controller = elementControllers[i];
19691969
var controllerResult = controller();
1970-
if (controllerResult !== controller.instance && (isObject(controllerResult) || isFunction(controllerResult))) {
1970+
if (controllerResult !== controller.instance) {
19711971
controller.instance = controllerResult;
19721972
$element.data('$' + directive.name + 'Controller', controllerResult);
19731973
if (controller === controllerForBindings) {

0 commit comments

Comments
 (0)