Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move template to external file #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

snapjay
Copy link

@snapjay snapjay commented Oct 28, 2014

Moved template to an external file to separate HTML from the JS
e.g. I don't have the Glythicon installed so I need to use my own template
Used the Bootstrap UI folder naming convention.

@sebastianha
Copy link
Owner

I also thought about externalizing the template but as far as I know this is a problem when minimizing / uglifying the code as the tools don't recognize the template and therefore do not include it. Or am I missing something?

One solution would be to include two versions, one with inline-template and one without. But then there has to be made a choice which version should be referenced as the main version in bower.json.

@sebastianha
Copy link
Owner

For one project I created a script doing this automatically ( https://gist.github.com/sebastianha/613e37aedfd99a1e9fa2 ) and I hooked it into pre-commit of git.

This could be a solution but then the bower.json decision is still open.

@jrgleason
Copy link

As far as I know minification is ok if you use html2js like the angular-ui
project. Check out my fork I can create a pull this weekend if you can't
figure it out.
On Oct 29, 2014 4:00 AM, "Sebastian Hammerl" [email protected]
wrote:

I also thought about externalizing the template but as far as I know this
is a problem when minimizing / uglifying the code as the tools don't
recognize the template and therefore do not include it. Or am I missing
something?

One solution would be to include two versions, one with inline-template
and one without. But then there has to be made a choice which version
should be referenced as the main version in bower.json.


Reply to this email directly or view it on GitHub
#8 (comment)
.

@sebastianha
Copy link
Owner

Thanks for the hint to html2js, this seems to be exactly what I was looking for! I will take a look at it.

@jrgleason
Copy link

Also allows you to use jade which I personally prefer :-)
On Oct 29, 2014 8:16 AM, "Sebastian Hammerl" [email protected]
wrote:

Thanks for the hint to html2js, this seems to be exactly what I was
looking for! I will take a look at it.


Reply to this email directly or view it on GitHub
#8 (comment)
.

@snapjay
Copy link
Author

snapjay commented Oct 29, 2014

Yeah - The minification is more a function of grunt/gulp compiling process.
It would be better to abstract the HTML from the JS.

I'd also say the same argument goes for abstracting the CSS you're including for the size attribute. Would be better for handle that thru the CSS not the JS
e.g. <checkbox class="large" />

@jrgleason
Copy link

Yeah I agree that making the large etc attr is bad but prob another issue
:-)
On Oct 29, 2014 9:22 AM, "Dan Shreim" [email protected] wrote:

Yeah - The minification is more a function of grunt/gulp compiling process.
It would be better to abstract the HTML from the JS.

I'd also say the same argument goes for abstracting the CSS you're
including for the size attribute. Would be better for handle that thru the
CSS not the JS
e.g.


Reply to this email directly or view it on GitHub
#8 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants