Having some trouble with search functionality in my "smart-table". I'm using Restangular to load data into the table successfully, but when I try to search, no data is displayed. I'm new to Angular and web development in general, so I'm a bit lost on how to fix it. Below is my code along with an example that works correctly. Any advice would be greatly appreciated.
This is my current code (search not working):
'use strict';
angular.module('NewApp')
.controller('ItemsCtrl', function ($scope, Item) {
$scope.items = Item.getList().$object;
});
The 'Item' module from app.js:
....
.factory('Item', function(ItemRestangular) {
return ItemRestangular.service('item');
});
And here is the code from the example where search works correctly:
'use strict';
angular.module('NewApp')
.controller('ItemsCtrl', function ($scope) {
$scope.items = [
{firstName: 'Laurent', lastName: 'Renard', birthDate: new Date('1987-05-21'), balance: 102, email: 'example1@example.com'},
{firstName: 'Blandine', lastName: 'Faivre', birthDate: new Date('1987-04-25'), balance: -2323.22, email: 'example2@example.com'},
{firstName: 'Francoise', lastName: 'Frere', birthDate: new Date('1955-08-27'), balance: 42343, email: 'example3@example.com'}
];
});
Here's a snippet of the HTML page:
...
<tr ng-repeat="item in items">
<td>{{item.firstName | uppercase}}</td>
...