swimlane / angular1-systemjs-seed

AngularJS 1.x + SystemJS Seed
MIT License
211 stars 40 forks source link

Handle Template Cache w/ ES6 #24

Closed amcdnl closed 9 years ago

amcdnl commented 9 years ago

With the new version of gulphtml2js we can define a custom header template, this would allow us to use ES6 better. https://github.com/marklagendijk/gulp-ng-html2js/pull/9

so templates might be like:

export var {templateFileName} = angular.module('....')

then you could use it like:

import {myTemplateFile} from './template.tpl';
lookfirst commented 9 years ago

Smoother is to just export default angular.module('...'), then you just write:

import myTemplateFile from './template.tpl'

Sadly the main developer rejected my pull request. =(

https://github.com/marklagendijk/gulp-ng-html2js/issues/15 https://github.com/marklagendijk/gulp-ng-html2js/pull/16

lookfirst commented 9 years ago

https://github.com/marklagendijk/gulp-ng-html2js/pull/17

lookfirst commented 9 years ago

Doesn't matter cause the object returned from angular.module has a .name property. Works great.

amcdnl commented 9 years ago

Fixed by latest push using template.