Posts

Showing posts from April, 2021

How to use AngularJS Services and Controllers

  In AngularJS, a service is a function, or object, that is available for, and limited to, your AngularJS application. Services AngularJS has about 30 built-in services. Here I’m going to explain most common used and advanced. The   service factory function  generates the single object or function that represents the service to the rest of the application. The object or function returned by the service is injected into any component (controller, service, filter or directive) that specifies a dependency on the service Location ·         The  $location  service has methods which return information about the location of the current web page: Example: var app = angular.module('myApp', []); app.controller('customersCtrl', function($scope, $location) {     $scope.myUrl = $location.mydataUrl(); }); HTTP ·         The  $http  service is one of the most comm...

Angular 11 - Angular-notifier

Image
angular-notifier 9.0.1 •  Public  • Published  22 days ago How to install You can get  angular-notifier  via  npm  by either adding it as a new  dependency  to your  package.json  file and running npm install, or running the following command: npm install angular-notifier Demo You can play around with this library with  this Stackblitz right here . Browse r support & polyfills By default, meaning without any polyfills,  angular-notifier  is compatible with  the latest versions of Chrome, Firefox, and Opera . Bringing in the following polyfills will improve browser support: To be able to use the latest and greatest JavaScript features in older browsers (e.g. older version of IE & Safari), you might want to add  core-js  to your polyfills. For animation support (in particular, for better  Web Animations API  support), you might want to use the  web-animations-js  poly...