Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

trying to bind delete button

  • Loading branch information...
commit 3f5faa659e6e7582dc2920589d8055552ec54282 1 parent 1f605a5
@qoobaa authored
Showing with 6 additions and 4 deletions.
  1. +1 −3 index.html
  2. +5 −1 lib/main.js
View
4 index.html
@@ -16,9 +16,7 @@
{{#collection contentBinding="Ficha.cardsController" tagName="ul"}}
{{content.front}} {{content.back}}
- {{#view SC.Button target="Ficha.cardsController" action="delete"}}
- Delete
- {{/view}}
+ {{#view SC.Button isActiveBinding="content.delete"}}Delete{{/view}}
{{/collection}}
</script>
</body>
View
6 lib/main.js
@@ -8,7 +8,11 @@ Ficha.Card = SC.Object.extend({
isValid: function () {
return this.get("front") && this.get("back");
- }.property("front", "back")
+ }.property("front", "back"),
+
+ delete: function () {
+ console.log("delete");
+ }
});
Ficha.cardsController = SC.ArrayController.create({
Please sign in to comment.
Something went wrong with that request. Please try again.