daviesgeek.com

Posts tagged with 'Development'

Angular Service Providers with config

May 22, 2015

Simple example of an Angular service provider with configuration option(s): var app = angular.module("app", []); app.service('service', function() { var service = function (enabled) { this.enabled = enabled } service.prototype.isEnabled = function() { return this.enabled } return service }) app.provider('MyCoolService', function () { var enabled; return { setEnabled: function (isEnabled) { enabled = isEnabled; }, $get: function (service) { return new service(enabled) } }; }); app.config(function (MyCoolServiceProvider) { MyCoolServiceProvider.setEnabled(true) }); app.controller("Controller", function ($scope, MyCoolService) { $scope.

Google Chrome 41 update

Mar 6, 2015

Cool updates to Google Chrome today. More recently I have been doing cross-browser testing in Firefox. One of the features of the Firefox inspector is a nice little highlight that shows up on elements that have changing properties: Chrome recently added this feature in the latest update (v41) As you can see, it is a very useful tool for any web developer using Chrome’s (or Firefox’s) inspector. Thank you Google :)