angular-html2js 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/app/log/test.log +6 -0
- data/lib/angular/html2js/template.rb +10 -10
- data/lib/angular/html2js/version.rb +1 -1
- data/spec/support/template_cache.coffee +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53a1d5b77e2db918fe9e11902356eca23f6f8102
|
4
|
+
data.tar.gz: d047d76543c60efc8eb8cabb9c477e8b29207040
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11d0638ac8fc1979db3c2c2c2a34ebd36ca9cf5705317bfe07c923bdb07c2fd72d52b56413d53c969c3255b85aac82b741b9401481868dfe0611abf6c54e338e
|
7
|
+
data.tar.gz: 781e065057901107fe12b9e8c760c918196e8106ad2d3f6b6bcc768ef9f0e5442dad683ea9b7417c82999ec3aeea16f7033d08ebbf314948df92dca8347243b4
|
data/README.md
CHANGED
@@ -152,6 +152,14 @@ angular.module('myApp').directive('myDirective', function($injectable){
|
|
152
152
|
}
|
153
153
|
});
|
154
154
|
```
|
155
|
+
|
156
|
+
## Important Note:
|
157
|
+
|
158
|
+
If you change anything in the configuration, be sure you clear your asset cache to ensure the templates get
|
159
|
+
updated. You can do this in a Rails app by running `rake tmp:clear` or `rm -rf tmp/cache/assets` from the app root.
|
160
|
+
|
161
|
+
This is necessary because Sprockets is only designed to watch the asset _source files_ for changes. It is unaware
|
162
|
+
that the template files have a dependency on the application configuration and therefore doesn't regenerate the templates.
|
155
163
|
|
156
164
|
## Contributing
|
157
165
|
|
@@ -160,3 +168,7 @@ angular.module('myApp').directive('myDirective', function($injectable){
|
|
160
168
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
161
169
|
4. Push to the branch (`git push origin my-new-feature`)
|
162
170
|
5. Create new Pull Request
|
171
|
+
|
172
|
+
|
173
|
+
[](https://bitdeli.com/free "Bitdeli Badge")
|
174
|
+
|
data/app/log/test.log
CHANGED
@@ -461,3 +461,9 @@ Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-13 12:41:3
|
|
461
461
|
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-09-13 12:51:09 -0500
|
462
462
|
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-09-13 12:51:10 -0500
|
463
463
|
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-09-13 12:51:10 -0500
|
464
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-10-31 12:17:26 -0400
|
465
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-10-31 12:17:26 -0400
|
466
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-10-31 12:17:26 -0400
|
467
|
+
Started GET "/assets/templates/test.ngt" for 127.0.0.1 at 2013-10-31 12:22:52 -0400
|
468
|
+
Started GET "/assets/templates/test_haml.js" for 127.0.0.1 at 2013-10-31 12:22:52 -0400
|
469
|
+
Started GET "/assets/templates/test_html.js" for 127.0.0.1 at 2013-10-31 12:22:52 -0400
|
@@ -11,24 +11,24 @@ module Angular
|
|
11
11
|
end
|
12
12
|
|
13
13
|
TEMPLATE = <<-TEMPLATE
|
14
|
-
angular.module(
|
15
|
-
$templateCache.put(
|
16
|
-
|
17
|
-
});
|
14
|
+
angular.module('%s', []).run(['$templateCache', function($templateCache) {
|
15
|
+
$templateCache.put('%s',
|
16
|
+
'%s');
|
17
|
+
}]);
|
18
18
|
TEMPLATE
|
19
19
|
|
20
20
|
|
21
21
|
SINGLE_MODULE_TPL = <<-SINGLE_MODULE_TPL
|
22
22
|
(function(module) {
|
23
23
|
try {
|
24
|
-
module = angular.module(
|
24
|
+
module = angular.module('%s');
|
25
25
|
} catch (e) {
|
26
|
-
module = angular.module(
|
26
|
+
module = angular.module('%s', []);
|
27
27
|
}
|
28
|
-
module.run(function($templateCache) {
|
29
|
-
$templateCache.put(
|
30
|
-
|
31
|
-
});
|
28
|
+
module.run(['$templateCache', function($templateCache) {
|
29
|
+
$templateCache.put('%s',
|
30
|
+
'%s');
|
31
|
+
}]);
|
32
32
|
})();
|
33
33
|
SINGLE_MODULE_TPL
|
34
34
|
|
@@ -2,7 +2,11 @@ class AngularModule
|
|
2
2
|
constructor: (@name, @deps) ->
|
3
3
|
templates = @templates = {}
|
4
4
|
|
5
|
-
run: (
|
5
|
+
run: (injectable) ->
|
6
|
+
if injectable instanceof Array
|
7
|
+
[injected..., block] = injectable
|
8
|
+
else
|
9
|
+
block = injectable
|
6
10
|
block
|
7
11
|
put: (id, content) =>
|
8
12
|
@templates[id] = content
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular-html2js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|