Skip to content

Commit

Permalink
AngularJs app
Browse files Browse the repository at this point in the history
  • Loading branch information
raylight75 committed Mar 2, 2016
1 parent 8b27096 commit 434b965
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion public/js/productCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ var myApp = angular.module('myApp', ['angular-toArrayFilter','angularUtils.direc
myApp.controller('productCtrl', function ($scope, $http) {
$http.get("api").then(function (response) {
console.log(response);
$scope.items = response.data;
$scope.array = response.data;
$scope.items = [];
angular.forEach($scope.array, function(key) {
$scope.items.push(key);
});
$scope.orderProp = 'product_id';
$scope.latest = 6;
//console.log($scope.items);
//$scope.items = response.data;//for toArrayFilter
/*var pagesShown = 1;
var pageSize = 3;
$scope.paginationLimit = function(data) {
Expand Down
5 changes: 3 additions & 2 deletions resources/views/frontend/livesearch.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
<h2><?= _('Featured products')?></h2>
<h3 >Type a letter:</h3>
<p><input type="text" class="form-control" ng-model="products"></p>
{{-- PAGINATION <div dir-paginate="row in items | toArray : false | filter:products | orderBy:orderProp | limitTo:latest | itemsPerPage:3"--}}
<div ng-repeat="row in items | toArray : false | filter:products | orderBy:orderProp | limitTo:latest"
{{-- PAGINATION <div dir-paginate="row in items | filter:products | orderBy:orderProp | limitTo:latest | itemsPerPage:3"--}}
<div ng-repeat="row in items | filter:products | orderBy:orderProp | limitTo:latest"
{{-- | toArray : false --}}
{{-- LOAD MORE limitTo:paginationLimit --}}
class="col-lg-3 col-md-3 col-sm-4 col-xs-6 col-ss-12 padbot40">
<div class="tovar_item">
Expand Down

0 comments on commit 434b965

Please sign in to comment.