Created
April 3, 2023 08:48
-
-
Save nathanwoulfe/30f25259bd978bcd7e27dc76d8818859 to your computer and use it in GitHub Desktop.
Get ancestor scope in AngularJs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getEditorScope = $scope => { | |
let editorScope = $scope.$parent; | |
do { | |
editorScope = editorScope.$parent; | |
} while (!Object.prototype.hasOwnProperty.call(editorScope, 'contentForm')); | |
this.editorScope = editorScope; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment