Category Archives: angularjs-2.0

AngularJS2 + Apache routing

I'm currently using Angular2 with Apache and I have a problem: when I use routing and navigate through pages, template syntax doesn't work, I just get an empty space in the place where {{}} is in the template. Also ngOnInit seems to be not working. When I use lite-server everything works fine. EDIT1: I'm trying to run an example from developer's guide on routing: https://angular.io/docs/ts/latest/guide/router.html https://angular.io/resources/live-examples/router/ts/plnkr.html

EDIT2: I'm also using CodeIgniter 3 and it already uses the following .htaccess file:

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]