Skip to content

Commit 5b41e47

Browse files
Foxandxsspkozlowski-opensource
authored andcommitted
refactor(demos): use angular modules
Closes angular-ui#1912
1 parent a316e3e commit 5b41e47

File tree

19 files changed

+40
-43
lines changed

19 files changed

+40
-43
lines changed

misc/demo/assets/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('bootstrapDemoApp', ['ui.bootstrap', 'plunker', 'ngTouch'], function($httpProvider){
1+
angular.module('ui.bootstrap.demo', ['ui.bootstrap', 'plunker', 'ngTouch'], function($httpProvider){
22
FastClick.attach(document.body);
33
delete $httpProvider.defaults.headers.common['X-Requested-With'];
44
}).run(['$location', function($location){
@@ -89,4 +89,4 @@ var DownloadCtrl = function($scope, $modalInstance) {
8989
$scope.cancel = function () {
9090
$modalInstance.dismiss();
9191
};
92-
}
92+
};

misc/demo/assets/plunker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ angular.module('plunker', [])
1313

1414
var indexContent = function (content, version) {
1515
return '<!doctype html>\n' +
16-
'<html ng-app="plunker">\n' +
16+
'<html ng-app="ui.bootstrap.demo">\n' +
1717
' <head>\n' +
1818
' <script src="//ajax.googleapis.com/ajax/libs/angularjs/'+ngVersion+'/angular.js"></script>\n' +
1919
' <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-'+version+'.js"></script>\n' +
@@ -27,7 +27,7 @@ angular.module('plunker', [])
2727
};
2828

2929
var scriptContent = function(content) {
30-
return "angular.module('plunker', ['ui.bootstrap']);" + "\n" + content;
30+
return "angular.module('ui.bootstrap.demo', ['ui.bootstrap']);" + "\n" + content;
3131
};
3232

3333
addField('description', 'http://angular-ui.github.io/bootstrap/');

misc/demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en" ng-app="bootstrapDemoApp" id="top">
2+
<html lang="en" ng-app="ui.bootstrap.demo" id="top">
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">

src/accordion/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function AccordionDemoCtrl($scope) {
1+
angular.module('ui.bootstrap.demo').controller('AccordionDemoCtrl', function ($scope) {
22
$scope.oneAtATime = true;
33

44
$scope.groups = [
@@ -23,4 +23,4 @@ function AccordionDemoCtrl($scope) {
2323
isFirstOpen: true,
2424
isFirstDisabled: false
2525
};
26-
}
26+
});

src/alert/docs/demo.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function AlertDemoCtrl($scope) {
1+
angular.module('ui.bootstrap.demo').controller('AlertDemoCtrl', function ($scope) {
22
$scope.alerts = [
33
{ type: 'danger', msg: 'Oh snap! Change a few things up and try submitting again.' },
44
{ type: 'success', msg: 'Well done! You successfully read this important alert message.' }
@@ -11,5 +11,4 @@ function AlertDemoCtrl($scope) {
1111
$scope.closeAlert = function(index) {
1212
$scope.alerts.splice(index, 1);
1313
};
14-
15-
}
14+
});

src/buttons/docs/demo.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
var ButtonsCtrl = function ($scope) {
2-
1+
angular.module('ui.bootstrap.demo').controller('ButtonsCtrl', function ($scope) {
32
$scope.singleModel = 1;
43

54
$scope.radioModel = 'Middle';
@@ -9,4 +8,4 @@ var ButtonsCtrl = function ($scope) {
98
middle: true,
109
right: false
1110
};
12-
};
11+
});

src/carousel/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function CarouselDemoCtrl($scope) {
1+
angular.module('ui.bootstrap.demo').controller('CarouselDemoCtrl', function ($scope) {
22
$scope.myInterval = 5000;
33
var slides = $scope.slides = [];
44
$scope.addSlide = function() {
@@ -12,4 +12,4 @@ function CarouselDemoCtrl($scope) {
1212
for (var i=0; i<4; i++) {
1313
$scope.addSlide();
1414
}
15-
}
15+
});

src/collapse/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
function CollapseDemoCtrl($scope) {
1+
angular.module('ui.bootstrap.demo').controller('CollapseDemoCtrl', function ($scope) {
22
$scope.isCollapsed = false;
3-
}
3+
});

src/datepicker/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var DatepickerDemoCtrl = function ($scope) {
1+
angular.module('ui.bootstrap.demo').controller('DatepickerDemoCtrl', function ($scope) {
22
$scope.today = function() {
33
$scope.dt = new Date();
44
};
@@ -33,4 +33,4 @@ var DatepickerDemoCtrl = function ($scope) {
3333
$scope.initDate = new Date('2016-15-20');
3434
$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
3535
$scope.format = $scope.formats[0];
36-
};
36+
});

src/dropdown/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function DropdownCtrl($scope) {
1+
angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope) {
22
$scope.items = [
33
'The first choice!',
44
'And another choice for you.',
@@ -18,4 +18,4 @@ function DropdownCtrl($scope) {
1818
$event.stopPropagation();
1919
$scope.status.isopen = !$scope.status.isopen;
2020
};
21-
}
21+
});

0 commit comments

Comments
 (0)