-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #343 from julienrf/lighthouse-1103-patch
[#1103] Add a jsRoute tag
- Loading branch information
Showing
6 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
samples-and-tests/just-test-cases/app/views/Application/jsRoute.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#{extends 'main.html' /} | ||
|
||
<script type="text/javascript"> | ||
function set(eltId, content) { | ||
var elt = document.getElementById(eltId); | ||
if (elt !== null) { | ||
elt.textContent = content; | ||
} | ||
} | ||
</script> | ||
|
||
<div id="a-url"></div> | ||
<div id="a-method"></div> | ||
|
||
<div id="b-url"></div> | ||
<div id="b-method"></div> | ||
|
||
<div id="c"></div> | ||
|
||
<script type="text/javascript"> | ||
var a = #{jsRoute @Application.index() /}; | ||
set('a-url', a.url()); | ||
set('a-method', a.method); | ||
|
||
var b = #{jsRoute @Application.hello() /}; | ||
set('b-url', b.url()); | ||
set('b-method', b.method); | ||
|
||
var c = #{jsRoute @Rest.postOrPut(':id') /}; | ||
set('c', c.url({id: 'foo'})); | ||
</script> |
3 changes: 3 additions & 0 deletions
3
samples-and-tests/just-test-cases/app/views/Application/jsRouteError.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script type="text/javascript"> | ||
#{jsRoute 'toto' /} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters