For security reasons, the browser does not allow a direct request to the file system. This gives you an error when working with routing and ajax requests in angular. Thus, you need to use a simple HTTP server, or you can create it using nodejs .
Refer Using Node.js as a Simple Web Server
Install apache2 server on Linux:
sudo apt-get install apache2
After that, you just need to put your code in /var/www/yourDirectory . Now you can access your code via http://localhost/yourDirectory
Darshan patel
source share