Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I am trying to get a button to produce a prompt using ng-mouseeneter, but I can't seem to get it working. Below is the code I have.
<span class="button" ng-mouseover="prompt('hello')">Say hello</span>
The expression you pass into ng-mouseover is not evaluated against the global scope (window object), it's evaluated against an angular $scope.
ng-mouseover
You can put window.prompt on the $rootScope:
window.prompt
$rootScope
app.run(function($rootScope,$window){ $rootScope.prompt = $window.prompt; });
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.