0

I have a directive in my angular code which has an inline template property for the sake of app load times. The template is becoming large and unwieldy so I thought about using a templateUrl property but I want to simplify my code without slowing down the load times.

So ... I was wondering if its possible to use Grunt to minify a html template file and then substitute the string right into the template property of a directive, and with such build magic get best of both worlds: ease of development and fast load times.

1 Answer 1

3

You can use grunt-angular-templates.

All you have to do, is putting your partials in external html files and referencing them as usual using the templateUrl attribute. grunt-angular-templates will minify all of your templates and put them into a single modules $templateCache.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.