-
Notifications
You must be signed in to change notification settings - Fork 23
Adding a Route
Joshua Nussbaum edited this page Jan 24, 2015
·
1 revision
Edit your app/assets/javascripts/sprangular/extraRoutes.coffee and add the route. For example:
angular.module('MyApp').config ($routeProvider) ->
$routeProvider
.when '/about',
template: '<h1>#1 Internet Site</h1>'
.when '/team',
controller: 'TeamCtrl',
templateUrl: 'team/index.html'# in app/assets/sprangular/controllers/team.coffee
angular.module('MyApp').controller 'TeamCtrl', ($scope) ->
$scope.members = [
{name: "Josh", title: "Developer"}
{name: "Bryan", title: "Developer"}
]// in app/assets/templates/team/index.html.slim
ul
li(ng-repeat='member in members')
span.name(ng-bind='member.name')
span.occupation(ng-bind='member.title')