You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
angular.module('panelApp').controller('OptionsCtrl', function OptionsCtrl($scope, appInfo, appHighlight) {
|
|
|
|
$scope.debugger = {
|
|
scopes: false,
|
|
bindings: false,
|
|
app: false
|
|
};
|
|
|
|
['scopes', 'bindings', 'app'].forEach(function (thing) {
|
|
$scope.$watch('debugger.' + thing, function (val) {
|
|
appHighlight[thing](val);
|
|
});
|
|
});
|
|
|
|
appInfo.getAngularVersion(function (version) {
|
|
$scope.$apply(function () {
|
|
$scope.version = version;
|
|
});
|
|
});
|
|
|
|
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;
|
|
}
|
|
});
|
|
});
|
|
|
|
});
|