Skip to content

Commit

Permalink
Demo site: controllers definition changed to module .controller() a…
Browse files Browse the repository at this point in the history
…pproach; angular updated to 1.3.0-beta.17

Closes artch#51
  • Loading branch information
artch committed Aug 2, 2014
1 parent bb10117 commit c92e099
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {

.segment('s1', {
templateUrl: 'templates/section1.html',
controller: MainCtrl})
controller: 'MainCtrl'})

.within()

Expand All @@ -35,7 +35,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {

.segment('itemInfo', {
templateUrl: 'templates/section1/item.html',
controller: Section1ItemCtrl,
controller: 'Section1ItemCtrl',
dependencies: ['id']})

.within()
Expand All @@ -56,7 +56,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {

.segment('s2', {
templateUrl: 'templates/section2.html',
controller: MainCtrl})
controller: 'MainCtrl'})

.within()

Expand Down Expand Up @@ -177,43 +177,43 @@ app.config(function($routeSegmentProvider, $routeProvider) {

app.value('loader', {show: false});

function MainCtrl($scope, $routeSegment, loader) {
app.controller('MainCtrl', function($scope, $routeSegment, loader) {

$scope.$routeSegment = $routeSegment;
$scope.loader = loader;

$scope.$on('routeSegmentChange', function() {
loader.show = false;
})
}
});

function Section1Ctrl($scope, $routeSegment) {
app.controller('Section1Ctrl', function($scope, $routeSegment) {

$scope.$routeSegment = $routeSegment;
$scope.test = { btnClicked: false };
$scope.items = [ 1,2,3,4,5 ];
}
});

function Section1ItemCtrl($scope, $routeSegment) {
app.controller('Section1ItemCtrl', function($scope, $routeSegment) {

$scope.$routeSegment = $routeSegment;
$scope.item = { id: $routeSegment.$routeParams.id };
$scope.test = { textValue: '' };
}
});

function Section2Ctrl($scope, $routeSegment) {
app.controller('Section2Ctrl', function($scope, $routeSegment) {

$scope.$routeSegment = $routeSegment;
$scope.test = { textValue: '' };
$scope.items = [ 1,2,3,4,5,6,7,8,9 ];
}
});

function ErrorCtrl($scope, error) {
app.controller('ErrorCtrl', function($scope, error) {
$scope.error = error;
}
});

function SlowDataCtrl($scope, data, loader) {
app.controller('SlowDataCtrl', function($scope, data, loader) {
loader.show = false;
$scope.data = data;
}
});

6 changes: 3 additions & 3 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
</div>


<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-route.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-animate.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular-route.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular-animate.js"></script>
<script src="../build/angular-route-segment.min.js"></script>
<script src="app.js"></script>

Expand Down

0 comments on commit c92e099

Please sign in to comment.