I am really new to Angular and I have a little question about submitting a template or url to ng-view. But just as I am going to do, I may need ng-view in my base template.
When my template database looks like this:
<body>
<div ng-view></div>
</body>
And my JS looks like this:
var app = angular.module('myApp',[])
.config(['$routeProvider', '$locationProvider', '$httpProvider', function($routeProvider, $locationProvider, $httpProvider) {
$routeProvider
.when('/home', {
templateUrl: '/contato'
})
(...)
Works with exact loading of the URL inside ng-view when I have only one case of ng-view, HOW TO ENSURE IF I need to have more than one ng-view to load? (for example: ng-view = "area1" and ng-view = "area2")
I tried in each $ routeProvider, but did not work:
$routeProvider
.when('/home', {
area1: {templateUrl: '/path1'},
area2: {templateUrl: '/path2'}
})
How to install each ng-view separately?
Appreciate any help! Thanks.
source
share