Skip to content

Commit

Permalink
bug demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Lehn committed Feb 21, 2015
1 parent 9a85015 commit 699080e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/action-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ app.factory('actionCreator', function (dispatcher, colorApi, aboutApi, colorStor

return false;
},

stuck: function(route) {

},

toggleColor: function(payload) {
dispatcher.dispatch('toggle:color', payload);
Expand Down
1 change: 1 addition & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ app.config(function($locationProvider, $stateProvider) {

.state('home', { template: '<home />' })
.state('about', { template: '<about />' })
.state('stuck', { template: '<stuck />' })

});

10 changes: 10 additions & 0 deletions src/directives.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
app.directive('stuck', function() {
return {
restrict: 'E',
scope: {},
templateUrl: 'stuck.html'
}
});

app.directive('home', function() {
return {
Expand All @@ -14,6 +21,9 @@ app.controller('HomeCtrl', function($scope, colorUtils, colorStore, actionCreato
$scope.aboutClick = function() {
actionCreator.goto({path:'/about'});
};
$scope.stuckClick = function() {
actionCreator.goto({path:'/stuck'});
};
});

app.directive('about', function() {
Expand Down
1 change: 1 addition & 0 deletions src/home.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<a href="#" ng-click="aboutClick()">?</a>
<a href="#" ng-click="stuckClick()">?</a>

<color-selector
colors="colorStore.colorFilters"
Expand Down
8 changes: 6 additions & 2 deletions src/stores.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ app.factory('routeStore', function(dispatcher, $rootScope, $state, $location) {
return dispatcher.registerStore({
storeName: 'routeStore',
currentRoute: undefined,
pathChangedInternally: undefined,
pathChangedInternally: false,

router: new Router({ // this is routr https://github.com/yahoo/routr

Expand All @@ -35,8 +35,12 @@ app.factory('routeStore', function(dispatcher, $rootScope, $state, $location) {
about: {
path: '/about',
method: 'get'
}
},

stuck: {
path: '/stuck',
method: 'get'
}
}),

getRouteFromPath: function (path) {
Expand Down
1 change: 1 addition & 0 deletions src/stuck.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>now we can't navigate with browser buttons</h1>

0 comments on commit 699080e

Please sign in to comment.