When I develop angular applications I often need to know which scope is bound to the element in debug console. We have the document with following structure. <html> <body> <div id=”result”></div> </body> </html> I open the developer console in google chrome browser and write this command. angular.element(“div#result”).scope() This solution has disadvantage if you want to know […]

Hello everyone, today I needed a function that will be in all angular controllers that I use in my application. After while I found this solution: myApp .run(function ($rootScope) { $rootScope.translate = function(key){ return lang[key]; } }) on a page: <button class=”my-button” > {{translate(“my-key”);}} </button> I hope this will help someone as it helped me.