On my index.php page, I have a ui-sref link set up like this
<a ui-sref="storysolo({ storyId: headline.nid })">
Additionally, my main js file is loading the angular code in the following manner
var rebelFleet = angular.module("CougsApp", ["ui.router","ngAnimate", "ui.bootstrap", "ngSanitize", "slick","CougsApp.headlines","CougsApp.story","CougsApp.recentstories" ]);
rebelFleet.config(function($stateProvider) {
// For any unmatched url, redirect to /state1
$stateProvider
.state('index', {
url: "",
views: {
"navViewPort": { templateUrl: '/components/nav/nav.html'
},
"contentViewPort": {
templateUrl: '/components/headlines/headlines.html',
controller: "headlinesCtrl"
},
"eventsViewPort": { templateUrl: '/components/scroller/scroller.html' },
"bottomContentViewPort": { templateUrl: '/components/recentstories/recentstories.html',
controller: "recentstoriesCtrl"
},
"rightsideViewPort": { templateUrl: '/components/social/social.html' },
"footerViewPort": { templateUrl: '/components/footer/footer.html' }
}
})
Furthermore, my story.js file is attempting to load with its own routing. Here's how
var ywing = angular.module('CougsApp.story', ["ui.router"]);
ywing.config(function($stateProvider, $urlRouterProvider) {
$stateProvider.state('storySolo', {
url: '/story/:storyId',
views: {
"navViewPort": { templateUrl: '/components/nav/nav.html'
},
"contentViewPort": {
templateUrl: '/components/story/story.html',
controller: "storyCtrl"
},
"footerViewPort": { templateUrl: '/components/footer/footer.html' }
}
})
});
When I try to click on the ui-sref link on the page, I encounter this error
Could not resolve 'storysolo' from state 'index'
The order in which my files are loaded is as follows
- angular.js,
- angular-sanitize.js,
- angular-ui-router.js,
- rebelFleet.js, (the main js file)
- story.js
I suspect there might be an issue with how the routes are being loaded, causing UI-Router to have trouble. Any assistance would be greatly appreciated.