Hi there, I am completely new to using Angular. I am attempting to insert some predefined data into a table, but I keep encountering 2 errors when I attempt to do so: 1. Uncaught ReferenceError: LookUpCtrl is not defined 2. Error: [ng:areq] Argument 'lookup.controller' is not a function, got undefined
This is the code for my controller lookup.controller.js
(function () {
'use strict';
angular
.module('crm.ma')
.controller('LookUpCtrl', LookUpCtrl);
function LookupCtrl() {
var vm = this;
vm.results = [
{
accountId: 1,
accountName: 'some name',
address: '201 some st',
city: 'Columbus',
state: 'OH',
zip: 'zip',
phone: '999-999-9999',
parentName: 'Parent 1',
accountType: 'Type 1',
accountStatus: 'Status 1',
creditTerm: 'Term 1'
},
{
accountId: 2,
accountName: 'some name',
address: '201 some st',
city: 'Columbus',
state: 'OH',
zip: 'zip',
phone: '999-999-9999',
parentName: 'Parent 1',
accountType: 'Type 1',
accountStatus: 'Status 1',
creditTerm: 'Term 1'
}
];
}
}());
This is the content of my view lookup.html
<div>
<div>Lookup Results</div>
<table>
<thead>
<tr>
<td>Acc. ID</td>
<td>Acc. Name</td>
<td>Acc Address</td>
<td>City</td>
<td>Zip</td>
<td>Phone</td>
<td>Parent Name</td>
<td>Account Type</td>
<td>Account Status</td>
<td>Credit Term</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="result in vm.results">
<td>{{ result.accountId }}</td>
<td>{{ result.accountName }}</td>
<td>{{ result.address }}</td>
<td>{{ result.city }}</td>
<td>{{ result.state }}</td>
<td>{{ reuslt.zip }}</td>
<td>{{ result.phone }}</td>
<td>{{ result.parentName }}</td>
<td>{{ result.accountType }}</td>
<td>{{ result.accountStatus }}</td>
<td>{{ result.accountStatus }}</td>
<td>{{ result.creditTerm }}</td>
</tr>
</tbody>
</table>
Feel free to ask if you need any additional information. Thank you.