I am adapting Angular code example for States. Here is my configuration
which simplified version of the example.
app.config(
function ($stateProvider, $urlRouterProvider) {
$stateProvider
//////////////
// Contacts //
//////////////
.state('contacts', {
// With abstract set to true, that means this state can not be
explicitly activated.
// It can only be implicitly activated by activating one of it's
children.
abstract: true,
// This abstract state will prepend '/contacts' onto the urls of
all its children.
url: '/contacts',
// Example of loading a template from a file. This is also a top
level state,
// so this template file will be loaded and then inserted into
the ui-view
// within index.html.
templateUrl: 'app/views/contacts.html',
// You can pair a controller to your template. There *must* be a
template to pair with.
})
/////////////////////
// Contacts > List //
/////////////////////
// Using a '.' within a state name declares a child within a parent.
// So you have a new state 'list' within the parent 'contacts'
state.
.state('contacts.list', {
// Using an empty url means that this child state will become
active
// when its parent's url is navigated to. Urls of child states are
// automatically appended to the urls of their parent. So this
state's
// url is '/contacts' (because '/contacts' + '').
url: '',
// IMPORTANT: Now we have a state that is not a top level state.
Its
// template will be inserted into the ui-view within this state's
// parent's template; so the ui-view within contacts.html. This
is the
// most important thing to remember about templates.
templateUrl: 'app/views/contacts.list.html',
})
});
How can I load a new template into contacts.list when something is clicked
on in contacts?
I have been really struggling with this for a while. Please, help.
Thanks
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.