I'm completely new to Angular and I have a question regarding injecting a template or URL into multiple ng-views. However, my current approach involves having ng-view in my base template.
My base template structure is as follows:
<body>
<div ng-view></div>
</body>
And this is how my JS looks:
var app = angular.module('myApp',[])
.config(['$routeProvider', '$locationProvider', '$httpProvider', function($routeProvider, $locationProvider, $httpProvider) {
$routeProvider
.when('/home', {
templateUrl: '/contato'
})
(...)
It works perfectly fine for loading a URL inside ng-view when there's only ONE ng-view scenario. But what if I need to load more than one ng-view? (e.g., ng-view="area1" and ng-view="area2")
I've attempted to define each ng-view in the $routeProvider, but it doesn't seem to work:
$routeProvider
.when('/home', {
area1: {templateUrl: '/path1'},
area2: {templateUrl: '/path2'}
})
What would be the correct way to set up individual templates for each ng-view separately?
Any assistance on this matter would be highly appreciated! Thank you.