I have an AngularJS application that has two main sections and I have created routes for each section.
Everything was fine until after I added the second section and the additional routes to the config section of the app. I am getting the error:
Error: No reference point given for path '.blog'
Here is the Angular app config.
.config(function ($stateProvider, $urlRouterProvider, embedlyServiceProvider, $httpProvider, $locationProvider) {
$stateProvider
// SECTION 1
.state('blog', {
abstract:true,
url: '/blog',
templateUrl: '../../../../views/projects/templates/blog.html',
controller: 'projectController'
})
// nested states
// each of these sections will have their own view
// url will be nested (/blog/updates)
.state('blog.updates', {
url: '/updates',
templateUrl: '../../../../views/projects/templates/updates.html',
})
.state('blog.comments', {
url: '/comments',
templateUrl: '../../../../views/projects/templates/comments.html',
})
// SECTION 2
.state('build', {
url: '/build',
templateUrl: '../../views/forms/build.html',
controller: 'BuilderController'
})
// nested states
.state('build.basics', {
url: '/basics',
templateUrl: '../../views/forms/basics.html'
})
// url will be /build/products
.state('build.products', {
url: '/products',
templateUrl: '../../views/forms/products.html'
})
.state('build.blog', {
url: '/blog',
templateUrl: '../../views/forms/blog.html'
})
.state('build.profile', {
url: '/profile',
templateUrl: '../../views/forms/profile.html'
})
.state('build.payment', {
url: '/payment',
templateUrl: '../../views/forms/payment.html'
})
.state('build.team', {
url: '/team',
templateUrl: '../../views/projectbuilder/forms/team.html'
});
// catch all route
$urlRouterProvider.otherwise('/');
Here are the ui-srefs for the first section:
<div class="row">
<ul class="inline-list">
<li><a ui-sref-active="active" ui-sref=".blog">Blog</a></li>
<li><a ui-sref-active="active" ui-sref=".updates">Updates ({{formData.updatesCount}})</a></li>
<li><a ui-sref-active="active" ui-sref=".comments">Comments ({{formData.commentsCount}})</a></li>
</ul>
</div>
Here are the ui-srefs for the second section. This section is still working fine.
<ul class="side-nav">
<li><a ui-sref-active="active" ui-sref=".basics"><span>1</span> Basics</a></li>
<li><a ui-sref-active="active" ui-sref=".blog"><span>3</span> Blog</a></li>
<li><a ui-sref-active="active" ui-sref=".profile"><span>4</span> Profile</a></li>
<li><a ui-sref-active="active" ui-sref=".payment"><span>5</span> Payments</a></li>
<li><a ui-sref-active="active" ui-sref=".team"><span>6</span> Team</a></li>
</ul>
Thanks for any insight into this. I am fairly new at Angular and still getting my head around it.