This repository has been archived on 2020-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
angularjs-batarang/js/controllers/OptionsCtrl.js

41 lines
1.3 KiB
JavaScript
Raw Normal View History

2012-11-13 14:22:53 +00:00
panelApp.controller('OptionsCtrl', function OptionsCtrl($scope, appInfo, appHighlight) {
2012-07-02 21:09:51 +00:00
$scope.debugger = {
scopes: false,
bindings: false,
app: false
};
['scopes', 'bindings', 'app'].forEach(function (thing) {
$scope.$watch('debugger.' + thing, function (val) {
appHighlight[thing](val);
});
2012-07-02 21:09:51 +00:00
});
2012-07-10 19:10:12 +00:00
2012-11-13 14:22:53 +00:00
appInfo.getAngularVersion(function (version) {
$scope.$apply(function () {
$scope.version = version;
});
2012-07-10 19:10:12 +00:00
});
2012-11-13 14:22:53 +00:00
appInfo.getAngularSrc(function (status) {
$scope.$apply(function () {
switch(status) {
case 'good':
$scope.status = 'success';
$scope.explain = 'CDN detected';
break;
case 'bad':
$scope.status = 'important';
$scope.explain = 'You are using the old code.angularjs.org links, which are slow! You should switch to the new CDN link. See <a target="_blank" href="http://blog.angularjs.org/2012/07/angularjs-now-hosted-on-google-cdn.html">this post</a> for more info';
break;
case 'info':
$scope.status = 'info';
$scope.explain = 'You may want to use the CDN-hosted AngularJS files. See <a target="_blank" href="http://blog.angularjs.org/2012/07/angularjs-now-hosted-on-google-cdn.html">this post</a> for more info';
break;
}
});
});
2012-11-13 14:22:53 +00:00
2012-07-02 21:09:51 +00:00
});