Uncaught SyntaxError: Unexpected token <


I’ve started my app using a beta version of Creator and it grew alot, so I need now to change the whole structure of the app. Right now I have all my controllers and views in index.html, which is not a great idea.

I made a “templates” folder on my www folder and I’ve created here files corresponding to all my views.
Ex: my testPage.html file has this structure:

<ion-header-bar class="bar-assertive">
	<button class="button icon-left ion-chevron-left button-clear" ng-click="back()" translate='back'></button>
	<h1 class="title" style='margin-left:25%'>Test Sida</h1>

<ion-content padding="true" class="has-header">
	<h3 style='color:red'>A really awesome test page</h3>

I am importing the file in my index,html like this:

When I check my app with Chrome Developer Tools (m server is started with ionic serve --lab) I get this error:

Uncaught SyntaxError: Unexpected token <

I get it even twice for every file I import in index.html from my “templates” folder.

My question is: what am I missing? Should I write some kind of function instead?

Note: It this pretty obvious that I am new at Ionic, Angular and even JavaScript.

I should also mention that the app is performing normally, but I get this syntax error everytime and this bothers me. Can anyone help?

I found the error. Angular needs to add the type flag (and id maybe) when importing the script. It is something like this.

< script type=‘text/ng-template’ id=‘testPage.html’ src=“templates/testPage.html”>

I won’t delete my post, maybe it will help someone in the future.