astik / angular-combine Goto Github PK
View Code? Open in Web Editor NEWAllow loading of merge templates into a single HTML file.
License: MIT License
Allow loading of merge templates into a single HTML file.
License: MIT License
Hey @astik :)
Great work on this module.
When this code run:
$injector.get("$compile")(response.data)
Are all the "internal" templates (within the combined template) pushed to the $templateCache?
If the compile function does not push them into the $templateCache, i really wonder how this actually works, assuming a directive tries to use one of the internal templates within the combined template file.
Thanks!!
Hi,
I've similar module in my project. It is working fine until I upgrade to AngularJS 1.3, after which the script is throwing below error:
TypeError: undefined is not a function
at defaultHttpResponseTransform (http://localhost:9080/js/lib/angular/angular.js:8569:27)
at http://localhost:9080/js/lib/angular/angular.js:8517:12
at forEach (http://localhost:9080/js/lib/angular/angular.js:335:20)
at transformData (http://localhost:9080/js/lib/angular/angular.js:8516:3)
at transformResponse (http://localhost:9080/js/lib/angular/angular.js:9224:23)
at processQueue (http://localhost:9080/js/lib/angular/angular.js:12914:27)
at http://localhost:9080/js/lib/angular/angular.js:12930:27
at Scope.$eval (http://localhost:9080/js/lib/angular/angular.js:14123:28)
at Scope.$digest (http://localhost:9080/js/lib/angular/angular.js:13939:31)
at Scope.$apply (http://localhost:9080/js/lib/angular/angular.js:14227:24)
This could be related to angular/angular.js#2973 (also, report here nervgh/angular-file-upload#272) - not sure though.
Fix for this simple - we need to return headers
too from the combinedTplPromise.then
function, like below:
combinedTplPromise.then(function(response) {
return {
status: response.status,
data: origGetMethod(url),
headers: response.headers
};
});
Hope this will be useful to someone else.
Let me know if you wanted me to open a pull request.
Hi, I'm using directives like:
return {
restrict: 'E',
templateUrl: function (element, attr) {
return 'App/components/shared/cart/cart.html';
},
controller: 'cart.controller',
controllerAs: 'cart',
link: function (scope, element, attrs) {
}
};
and in my html I'll use:
<cart></cart>
I was wondering, can I use angular combine to bundle html files in this case?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.