Reputation: 1324
I have a controller named like this :
<div ng-controller="MainController as main" class="containerWrap">
I tried this for selecting my controller for further functioning :-
var a = document.querySelector('[ng-controller=MainController as main]');
var b = angular.element(chatElement).scope();
It gives an error :-
Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document': '[ng-controller=MainController as main]' is not a valid selector.
I tried for just MainController as well :-
That gives :-
a=null
b=undefined
Can anyone help?
Upvotes: 0
Views: 2120
Reputation: 6666
var a = document.querySelector('[ng-controller="MainController as main"]');
Upvotes: 2