0

I currently have a view in Angular where I am trying to run some PHP code to check a database and cookies etc, but unfortunately when I rename the file to view1.php instead of view1.html and also change it in the view1.js to

.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/view1', {
    templateUrl: 'view1/view1.php',
    controller: 'View1Ctrl'
  });
}])

The app will load but unfortunately everything that is in the View1Ctrl does not run. Is there any way to fix this? Just simply changing it all back to HTML and it works again. I am using a directive to display a html video from the view1.js

Thanks.

Curtis Boylan
  • 827
  • 1
  • 7
  • 23
  • Have you checked the console in Developer Tools for any errors? – Rhumborl May 02 '18 at 14:01
  • 1
    (_why does PHP front-end still exists?_) You can use PHP for partials / templates, but if you don't configure your back-end to parse HTML files as PHP then your PHP will not be parsed. Instead use HTML and pull any data from your database with `$http.get` requests – Aleksey Solovey May 02 '18 at 14:03
  • https://stackoverflow.com/q/26720047/697370 – Jeff Lambert May 02 '18 at 14:18

0 Answers0