Skip to content

Commit 57206cd

Browse files
committed
Update README/fixtures with className handling
1 parent 3f5bec0 commit 57206cd

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ angular.module("foo").directive("bar",
3636
<div>
3737
<h1>{{title}}</h1>
3838
<div class="bar" ng-click="go()">This is a bit more <em>advanced</em>.</div>
39+
<div className="bar">className will be converted to class.</div>
3940
</div>
4041
)
4142
}
@@ -48,7 +49,7 @@ angular.module("foo").directive("bar",
4849
function() {
4950
return {
5051
template: (
51-
"<div>\n <h1>{{title}}</h1>\n <div class=\"bar\" ng-click=\"go()\">This is a bit more <em>advanced</em>.</div>\n</div>"
52+
"<div>\n <h1>{{title}}</h1>\n <div class=\"bar\" ng-click=\"go()\">This is a bit more <em>advanced</em>.</div>\n <div class=\"bar\">className will be converted to class.</div>\n</div>"
5253
)
5354
}
5455
}

test/fixtures/1in.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ angular.module("foo").directive("bar",
55
<div>
66
<h1>{{title}}</h1>
77
<div class="bar" ng-click="go()">This is a bit more <em>advanced</em>.</div>
8+
<div className="bar">className will be converted to class.</div>
89
</div>
910
)
1011
}
1112
}
12-
);
13+
);

test/fixtures/1out.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ angular.module("foo").directive("bar",
22
function() {
33
return {
44
template: (
5-
"<div>\n <h1>{{title}}</h1>\n <div class=\"bar\" ng-click=\"go()\">This is a bit more <em>advanced</em>.</div>\n</div>"
5+
"<div>\n <h1>{{title}}</h1>\n <div class=\"bar\" ng-click=\"go()\">This is a bit more <em>advanced</em>.</div>\n <div class=\"bar\">className will be converted to class.</div>\n</div>"
66
)
77
}
88
}
9-
);
9+
);

test/test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ describe("angularjsx", function () {
1818
assert.equal(angularjsx.convert("var x = {template: <div class=\"foo\"></div>}"), "var x = {template: \"<div class=\\\"foo\\\"></div>\"}");
1919
});
2020
it("should ignore non-JSX properties named 'template'", function () {
21-
//TODO: \r\n on Windows only? Test on Linux.
22-
assert.equal(angularjsx.convert("var x = {template: {\n}}"), "var x = {template: {\r\n}}");
21+
assert.equal(angularjsx.convert("var x = {template: {\n}}"), "var x = {template: {\n}}");
2322
});
2423
it("should ignore string template", function () {
2524
assert.equal(angularjsx.convert("var x = {template: \"<br/>\"}"), "var x = {template: \"<br/>\"}");

0 commit comments

Comments
 (0)