It’s as easy as:
//true if angular is using jQuery, false if using jqLite angular.element === window.jQuery
It’s as easy as:
//true if angular is using jQuery, false if using jqLite angular.element === window.jQuery
Given the following HTML
How do we communicate the value known only to the directive but passing back to the controller’s scope? Like so:
I’m not entirely sure why certain keys on a keyboard fire keydown but not keyup, some fire keypress while others don’t and then in the backspace’s case, it only fires on keyup. Nevertheless I found myself in need of triggering action on backspace.
[gist https://gist.github.com/jusopi/b89fb2cd31a2da8d0fed]I was seeking an example of using a reusable modal container w/ common functionality that would wrap custom contents programmatically.
I was trying to draw parallels in AngularJS and something like RobotLegs (which is my preferred MVC framework when building Flex/Flash applications). Here are some interesting findings:
There is no need to inject both $scope & $rootScope in a controller definition. $scope is enough.
Angular has a built in event dispatching mechanism outside of the normal event dispatcher paradigm we see in JavaScript and ActionScript. For those ActionScript developers, $emit is the equivalent of dispatching a bubbling event that bubbles up through the display list. However in this case, Angular is bubbling up the $scope hierarchy. This bubbles up towards the $rootScope
This is the opposite of bubbling up an event. In this case, it’s drilling down descendent $scopes in the $scope hierarchy.