Skip to content

Commit

Permalink
Switch resource option in javascript app
Browse files Browse the repository at this point in the history
  • Loading branch information
Michiel-s authored and hanjoosten committed Mar 18, 2017
1 parent 6a39c43 commit d587bff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions static/zwolle/templates/controllers/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ AmpersandApp.controller('$interfaceName$Controller', function (\$scope, \$rootSc
\$scope.navLabel = (\$scope.resource.$interfaceName$[0] || {})._label_ ? \$scope.resource.$interfaceName$[0]._label_ : '...';
}
});

\$scope.switchResource = function(resourceId){
\$location.url('/$interfaceName$/' + resourceId);
}

// Create new resource and add data to \$scope.resource['$interfaceName$']
if(\$routeParams['new']){
Expand Down

0 comments on commit d587bff

Please sign in to comment.