Reputation: 1
I am new to angularjs I tried implement a simple code using angular but when try to run it in browser it keeps prompting errors in console
This is my code
<!DOCTYPE html>
<html lang="en">
<head>
<script src="app.module.js"></script>
<script src="angular.js"></script>
<script src="main.controller.js"></script>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body ng-app="DriverApp" >
<div ng-controller="MainController" >
<table>
<thead>
<tr>
<th></th>
<th>First name</th>
<th>Last name</th>
<th>Birthday</th>
<th>Vehicle</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="driver in drivers">
<td>{{driver.ranking}}</td>
<td>{{driver.firstName}}</td>
<td>{{driver.lastName}}</td>
<td>{{driver.birthday}}</td>
<td>{{driver.vehicle}}</td>
<td><a>Open</a></td>
</tr>
</tbody>
</table>
<form name="MyForm">
<div id="collapseExample" >
<br/>
<div>
<input type="text" placeholder="Rank" ng-model="driver.ranking">
</div>
<div>
<input type="text" placeholder="First name" ng-model="driver.firstName">
</div>
<div>
<input type="text" placeholder="Last name" ng-model="driver.lastName">
</div>
<div>
<input type="text" placeholder="Birthday" ng-model="driver.birthday">
</div>
<div>
<input type="text" placeholder="Vehicle" ng-model="driver.vehicle">
</div>
<div>
<button ng-click="addDriver()">Add</button>
</div>
<br/>
</div>
</form>
</div>
</body>
</html>
And i attached the error as a screen shot below
Upvotes: 0
Views: 577
Reputation: 1803
Try changing the order of the script files:
<script src="angular.js"></script>
<script src="app.module.js"></script>
<script src="main.controller.js"></script>
Upvotes: 1
Reputation: 17299
change order of included js files
<script src="angular.js"></script>
<script src="app.module.js"></script>
<script src="main.controller.js"></script>
Upvotes: 1