Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
refactor(demos): use angular modules
Browse files Browse the repository at this point in the history
Closes #1912
  • Loading branch information
Foxandxss authored and pkozlowski-opensource committed May 4, 2014
1 parent a316e3e commit 5b41e47
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 43 deletions.
4 changes: 2 additions & 2 deletions misc/demo/assets/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('bootstrapDemoApp', ['ui.bootstrap', 'plunker', 'ngTouch'], function($httpProvider){
angular.module('ui.bootstrap.demo', ['ui.bootstrap', 'plunker', 'ngTouch'], function($httpProvider){
FastClick.attach(document.body);
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}).run(['$location', function($location){
Expand Down Expand Up @@ -89,4 +89,4 @@ var DownloadCtrl = function($scope, $modalInstance) {
$scope.cancel = function () {
$modalInstance.dismiss();
};
}
};
4 changes: 2 additions & 2 deletions misc/demo/assets/plunker.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ angular.module('plunker', [])

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

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

addField('description', 'http://angular-ui.github.io/bootstrap/');
Expand Down
2 changes: 1 addition & 1 deletion misc/demo/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" ng-app="bootstrapDemoApp" id="top">
<html lang="en" ng-app="ui.bootstrap.demo" id="top">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down
4 changes: 2 additions & 2 deletions src/accordion/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function AccordionDemoCtrl($scope) {
angular.module('ui.bootstrap.demo').controller('AccordionDemoCtrl', function ($scope) {
$scope.oneAtATime = true;

$scope.groups = [
Expand All @@ -23,4 +23,4 @@ function AccordionDemoCtrl($scope) {
isFirstOpen: true,
isFirstDisabled: false
};
}
});
5 changes: 2 additions & 3 deletions src/alert/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function AlertDemoCtrl($scope) {
angular.module('ui.bootstrap.demo').controller('AlertDemoCtrl', function ($scope) {
$scope.alerts = [
{ type: 'danger', msg: 'Oh snap! Change a few things up and try submitting again.' },
{ type: 'success', msg: 'Well done! You successfully read this important alert message.' }
Expand All @@ -11,5 +11,4 @@ function AlertDemoCtrl($scope) {
$scope.closeAlert = function(index) {
$scope.alerts.splice(index, 1);
};

}
});
5 changes: 2 additions & 3 deletions src/buttons/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var ButtonsCtrl = function ($scope) {

angular.module('ui.bootstrap.demo').controller('ButtonsCtrl', function ($scope) {
$scope.singleModel = 1;

$scope.radioModel = 'Middle';
Expand All @@ -9,4 +8,4 @@ var ButtonsCtrl = function ($scope) {
middle: true,
right: false
};
};
});
4 changes: 2 additions & 2 deletions src/carousel/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function CarouselDemoCtrl($scope) {
angular.module('ui.bootstrap.demo').controller('CarouselDemoCtrl', function ($scope) {
$scope.myInterval = 5000;
var slides = $scope.slides = [];
$scope.addSlide = function() {
Expand All @@ -12,4 +12,4 @@ function CarouselDemoCtrl($scope) {
for (var i=0; i<4; i++) {
$scope.addSlide();
}
}
});
4 changes: 2 additions & 2 deletions src/collapse/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function CollapseDemoCtrl($scope) {
angular.module('ui.bootstrap.demo').controller('CollapseDemoCtrl', function ($scope) {
$scope.isCollapsed = false;
}
});
4 changes: 2 additions & 2 deletions src/datepicker/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var DatepickerDemoCtrl = function ($scope) {
angular.module('ui.bootstrap.demo').controller('DatepickerDemoCtrl', function ($scope) {
$scope.today = function() {
$scope.dt = new Date();
};
Expand Down Expand Up @@ -33,4 +33,4 @@ var DatepickerDemoCtrl = function ($scope) {
$scope.initDate = new Date('2016-15-20');
$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
$scope.format = $scope.formats[0];
};
});
4 changes: 2 additions & 2 deletions src/dropdown/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function DropdownCtrl($scope) {
angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope) {
$scope.items = [
'The first choice!',
'And another choice for you.',
Expand All @@ -18,4 +18,4 @@ function DropdownCtrl($scope) {
$event.stopPropagation();
$scope.status.isopen = !$scope.status.isopen;
};
}
});
10 changes: 5 additions & 5 deletions src/modal/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var ModalDemoCtrl = function ($scope, $modal, $log) {
angular.module('ui.bootstrap.demo').controller('ModalDemoCtrl', function ($scope, $modal, $log) {

$scope.items = ['item1', 'item2', 'item3'];

$scope.open = function (size) {

var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
controller: 'ModalInstanceCtrl',
size: size,
resolve: {
items: function () {
Expand All @@ -21,12 +21,12 @@ var ModalDemoCtrl = function ($scope, $modal, $log) {
$log.info('Modal dismissed at: ' + new Date());
});
};
};
});

// Please note that $modalInstance represents a modal window (instance) dependency.
// It is not the same as the $modal service used above.

var ModalInstanceCtrl = function ($scope, $modalInstance, items) {
angular.module('ui.bootstrap.demo').controller('ModalInstanceCtrl', function ($scope, $modalInstance, items) {

$scope.items = items;
$scope.selected = {
Expand All @@ -40,4 +40,4 @@ var ModalInstanceCtrl = function ($scope, $modalInstance, items) {
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
};
});
4 changes: 2 additions & 2 deletions src/pagination/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var PaginationDemoCtrl = function ($scope) {
angular.module('ui.bootstrap.demo').controller('PaginationDemoCtrl', function ($scope) {
$scope.totalItems = 64;
$scope.currentPage = 4;

Expand All @@ -13,4 +13,4 @@ var PaginationDemoCtrl = function ($scope) {
$scope.maxSize = 5;
$scope.bigTotalItems = 175;
$scope.bigCurrentPage = 1;
};
});
4 changes: 2 additions & 2 deletions src/popover/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var PopoverDemoCtrl = function ($scope) {
angular.module('ui.bootstrap.demo').controller('PopoverDemoCtrl', function ($scope) {
$scope.dynamicPopover = 'Hello, World!';
$scope.dynamicPopoverTitle = 'Title';
};
});
5 changes: 2 additions & 3 deletions src/progressbar/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var ProgressDemoCtrl = function ($scope) {

angular.module('ui.bootstrap.demo').controller('ProgressDemoCtrl', function ($scope) {
$scope.max = 200;

$scope.random = function() {
Expand Down Expand Up @@ -36,4 +35,4 @@ var ProgressDemoCtrl = function ($scope) {
}
};
$scope.randomStacked();
};
});
4 changes: 2 additions & 2 deletions src/rating/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var RatingDemoCtrl = function ($scope) {
angular.module('ui.bootstrap.demo').controller('RatingDemoCtrl', function ($scope) {
$scope.rate = 7;
$scope.max = 10;
$scope.isReadonly = false;
Expand All @@ -15,4 +15,4 @@ var RatingDemoCtrl = function ($scope) {
{stateOn: 'glyphicon-heart'},
{stateOff: 'glyphicon-off'}
];
};
});
4 changes: 2 additions & 2 deletions src/tabs/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var TabsDemoCtrl = function ($scope) {
angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function ($scope) {
$scope.tabs = [
{ title:'Dynamic Title 1', content:'Dynamic content 1' },
{ title:'Dynamic Title 2', content:'Dynamic content 2', disabled: true }
Expand All @@ -9,4 +9,4 @@ var TabsDemoCtrl = function ($scope) {
alert('You\'ve selected the alert tab!');
});
};
};
});
4 changes: 2 additions & 2 deletions src/timepicker/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var TimepickerDemoCtrl = function ($scope) {
angular.module('ui.bootstrap.demo').controller('TimepickerDemoCtrl', function ($scope) {
$scope.mytime = new Date();

$scope.hstep = 1;
Expand Down Expand Up @@ -28,4 +28,4 @@ var TimepickerDemoCtrl = function ($scope) {
$scope.clear = function() {
$scope.mytime = null;
};
};
});
4 changes: 2 additions & 2 deletions src/tooltip/docs/demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var TooltipDemoCtrl = function ($scope) {
angular.module('ui.bootstrap.demo').controller('TooltipDemoCtrl', function ($scope) {
$scope.dynamicTooltip = 'Hello, World!';
$scope.dynamicTooltipText = 'dynamic';
$scope.htmlTooltip = 'I\'ve been made <b>bold</b>!';
};
});
4 changes: 2 additions & 2 deletions src/typeahead/docs/demo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5b41e47

Please sign in to comment.