I have some accounts routes:
.when('/accounts', {
templateUrl: 'views/accounts.html',
controller: 'AccountsCtrl'
})
.when('/accounts/:accountId', {
//templateUrl: 'views/account-details.html', // adding this i get a SyntaxError: Unexpected token < and shows my ng-view within ng-view just weird
//controller: 'AccountsDetailCtrl'
})
and going to /accounts/:account
uses the account template which is not suited as it has a table that displays all the accounts. I want send it to a new route but at the same time would like to pass the userId as a parameter.
Is there a way to send the app to a new route with url parameters?
EDIT
To clarify some things I understand that I have $routeParams at my disposal when I successfully can send the app to a new route with no errors. But, commented above in the code if I set the template for '/accounts/:accountId'
I get an error.
SyntaxError: Unexpected token <
at eval (native)
at https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:2:2620
at Function.m.extend.globalEval (https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:2:2631)
at m.ajaxSetup.converters.text script (https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:4:26387)
at Pc (https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:4:18104)
at x (https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:4:21525)
at b (https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:4:25897)
at Object.send (https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:4:26001)
at Function.m.extend.ajax (https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:4:21302)
at Function.m._evalUrl (https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js:4:22522) <div class="col-md-10 col-md-offset-2 main ng-scope" ng-view="">
Im not sure why. All that my account-details.html
template has is Hello world