G
G
GaserV2015-10-25 14:26:50
Angular
GaserV, 2015-10-25 14:26:50

Problems with angular + laravel routing?

Tell. Here I have the whole project in the "ang" folder. I installed laravel in it. It seems that everything was registered as it should, but when I open "ang /" then instead of the site I see the structure of files and folders. And when I score "ang / public /" - then it opens. This is the first problem.
Here is the second one. Where should I store the files, in public or in views? Because they are now in views and ang-routes does not find them.
I understand that everything is because of the first problem. How to solve it?
Created a controller with content:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class HomeCoontroller extends Controller
{
  
  public function index() {

    return view('welcome');

  }

}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nicholas, 2015-10-26
@healqq

You decide where you will have routing. Either you have a SPA (single page application) and ng-route does the routing, and laravel acts as an API, or laravel does the routing. It's hard for me to imagine cases where the second option is better than the first, but I think they exist.

V
Vlad Tokarev, 2015-10-27
@Vadiok

If Laravel needs to be stored in a subdirectory, then it is better to change the paths in it altogether.
In this case access to laravel should work just by /ang/ , without public

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question