AngularJS Scope - Chrome App -
kind of new angular js i'm using create chrome app.
anyone know how can access chillax.breakinterval
(and other properties of 'chillax') within chrome.storage.sync.get
callback function?
angular.module('chillaxapp', []) .controller("chillaxcontroller", function () { var chillax = this; chillax.init = function() { var settings = {}; settings["enabled"] = ""; settings["reminderinterval"] = ""; settings["breakinterval"] = ""; settings["sound"] = ""; chrome.storage.sync.get(settings, function(obj) { // setting these variables here aren't available within controller chillax.reminderinterval = obj["reminderinterval"]; chillax.breakinterval = obj["breakinterval"]; chillax.sound = obj["sound"]; }); };
Comments
Post a Comment