Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is .tpl.html files? (angularjs)

Tags:

html

angularjs

I'm doing a angularjs blog tutorial, in the code example I see this new file type "tpl.html":

$routeProvider
.when('/', {
templateUrl: 'views/post-list.tpl.html',
controller: 'PostListController',
controllerAs: 'postlist'
})
.when('/post/:postId', {
templateUrl: 'views/post-detail.tpl.html',
controller: 'PostDetailController',
controllerAs: 'postdetail'
})
.when('/new', {
templateUrl: 'views/post-create.tpl.html',
controller: 'PostCreateController',
controllerAs: 'postcreate'
});

What is this file type? Is different to html files?

like image 706
Funny Frontend Avatar asked Jan 02 '16 22:01

Funny Frontend


2 Answers

The .tpl file extension is used by a template parser called Smarty. This is an HTML template parser. Developers append .html to the end of the file so they can be recognized by text editors as HTML file and provide syntax checking, intellisense, and stuff.

like image 136
hbadr Avatar answered Sep 28 '22 04:09

hbadr


It is just a little helper added by the author to mark these files as templates. This could be helpful when you see these files not in context - e.g. in the file system. You can name these html files how you like it! :)

like image 40
nipeco Avatar answered Sep 28 '22 06:09

nipeco