-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add standalone tests and fix can.view.autorender
- Loading branch information
Showing
6 changed files
with
51 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ dist/ | |
*.orig | ||
util/can.*.js | ||
*node_modules* | ||
standalone* | ||
docs* | ||
*.DS_Store | ||
.idea | ||
|
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
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,26 @@ | ||
<script> | ||
window.isReady = window.parent.isReady || function(el) { | ||
console.log(el.length); | ||
console.log(el.html()); | ||
}; | ||
window.hasError = window.parent.hasError || function(error) { | ||
console.log("error in autoload", error) | ||
}; | ||
window.removeMyself = window.parent.removeMyself; | ||
</script> | ||
<script src="../../../bower_components/jquery/dist/jquery.js"></script> | ||
<script src="../../../dist/can.jquery.js"></script> | ||
<script src="../../../dist/can.stache.js"></script> | ||
<script src="../../../dist/can.autorender.js"></script> | ||
<script src="standalone-basics.js"></script> | ||
|
||
<script type="text/stache" id="basics" foo="bar" can-autorender> | ||
<my-component></my-component> | ||
</script> | ||
<script> | ||
$(function() { | ||
can.autorender().then(function() { | ||
isReady($("body my-component"), can.viewModel('my-component')); | ||
}); | ||
}); | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(function() { | ||
window.MyComponent = can.Component.extend({ | ||
tag: "my-component", | ||
// call can.stache b/c it should be imported auto-magically | ||
template: can.stache("{{message}}"), | ||
scope: { | ||
message: "Hello World" | ||
}, | ||
events: { | ||
"inserted": function(){ | ||
this.element[0].className = "inserted"; | ||
} | ||
} | ||
}); | ||
})(); |