This is my html code
<link rel="stylesheet"
href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<!-- load angular via CDN -->
<script src="//code.angularjs.org/1.4.0-rc.2/angular.min.js"></script>
<script src="//code.angularjs.org/1.4.0-rc.2/angular-route.min.js ">
</script>
<script src="v2-app.js"></script>
<script src="components/where-to-buy/whereToBuyController.js"></script>
<script src="components/sku-listing/deviceController.js"></script>
<script src="directives.js"></script>
<nav class="tab-nav">
<div class="tab-nav-inner">
<div class="container-fluid" ng-controller="mainController">
<div class="row">
<ul class="nav nav-pills nav-justified th-menu">
<li role="presentation" ng-class="{active:isActive('/about')}" ><a href="#/about" ng-click="scrollToSection('content-section')">Erafone offer details</a></li>
<li role="presentation" ng-class="{active:isActive('/form')}"><a href="#/form" ng-click="scrollToSection('content-section')">Form</a></li>
</ul>
</div>
</div>
</div>
</nav>
<!-- Tab panes -->
<div class="container-fluid">
<ng-view>
</ng-view>
I want to load html view file on click of form using angular js. This is my js code
var dgApp = angular.module('dgApp', ['ngRoute']);
// ROUTE
dgApp.config(function($routeProvider){
$routeProvider
.when('/about',{
templateUrl: 'components/additional-info/v2-
additionalInfoView.html',
controller : 'mainController'
})
.when('/form',{
templateUrl: 'components/form/v2-formView.html',
controller : 'mainController'
})
.otherwise({ redirectTo: '/about' })
});
dgApp.controller('mainController', ['$scope' , '$location', '$http',
'$filter', function ($scope, $location, $http, $filter) {
$scope.scrollToSection = function(sectionID){
$('html, body').animate({
scrollTop: $("#"+sectionID).offset().top - 63
}, 800);
}
}]);
There are errors in console
ReferenceError: angular is not defined v2-app.js:2:4
TypeError: dgApp is undefined directives.js:1:0
TypeError: $ is not a function index.html:143:5
So I want load html view file on click form link on the same page in ng-view. What I made wrong in the above code?? If anybody has any idea then please guide me.