Hi I have a table of data that I'm trying to access via ng-repeat. I think I've got everything correct in my code, but when I load the page the data doesn't load. I'm not sure what I'm doing wrong. Here is my table:
<table class="table table-bordered table-hover table-responsive"
ng-repeat="sale in vm.sales">
<thead>
<tr>
<th>
Date Ordered
</th>
<th>
Retail
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
{{ sale.dateOrdered }}
</td>
<td>
{{ sale.firstLoadRetail}}
</td>
</tr>
<tr>
<th>
Subtotal
</th>
</tr>
</tbody>
Here is my controller:
(function () {
'use strict';
angular
.module('crm.ma')
.controller('ReportCtrl', ReportCtrl);
function ReportCtrl() {
var vm = this;
vm.sale = [
{
dateOrdered: '05/10/2015',
firstLoadRetail: '75',
firstLoadCost: '65',
instantProfitAirTime: '9',
instantProfitSpiff: '59',
netRetail: '75',
netCost: '7',
netProfit: '67',
count: '0',
billAmount: '45'
},
{
dateOrdered: '06/22/2015',
firstLoadRetail: '85',
firstLoadCost: '75',
instantProfitAirTime: '10',
instantProfitSpiff: '86',
netRetail: '22',
netCost: '8',
netProfit: '22',
count: '0',
billAmount: '35'
}
];
}
I'm getting the error message Argument 'report.controller' is not a function, got undefined. Last time I got this error message I had a typo, but I'm not seeing any typos in my code this time.
ng-controllerand assignvm, this line would seem to be the line the error you are describing is coming from. This isn't a complete example of your code. note that thevmmight be assigned in a router provider, and not in the HTML here.report.controlleras an invalid argument, but this isn't the area of the code base wherereport.controlleris used. have you searched forreport.controllerin your code?