mercredi 25 novembre 2015

Laravel 5 file path error in console

I am creating a web application using Laravel 5.

I want to use AngularJS. I have created a file named all-products.php in views directory which contains data in JSON format.

When I gave path to this file in http.open() it gives an error as http://localhost/user/app/resources/views/all-products.php 404 (Not Found).

Here is my JS code:

var app = angular.module("products", []);
    app.controller("productsController", function($scope, $http){
        $http.get("http://localhost/user/app/resources/views/all-products.php").success(function(response) {
            $scope.records = response.records;
        });
    });

Please tell me how I can solve this ?

Thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire