Method used to handle Falcon.View obects. This will handle fetching a view's viewmodel and html template. This method expects to use the native Knockout templating engine.
1 var MyView = Falcon.View.extend({url: '#my_view_template'});
2 Falcon.apply({my_view: new MyView()}, '#application');
1 <div id="application">
2 Who's View is this?!
3 <br />
4 <!-- ko view: my_view --><!-- /ko -->
5 </div>
6 <template id="my_view_template">
7 This is my View!
8 </template>
1 Who's View is this?!
2 This is my View!
This is the same as the Knockout's Foreach binding except that it has been modified to handle Falcon Collection's as well
1 var Dogs = Falcon.Collection.extend({ ... });
2
3 Falcon.apply({
4 dogs: new Dogs(),
5 cats: ko.observableArray([])
6 }, '#application');
1 <div id="application">
2 <div data-bind="foreach: dogs"> ... A List of Dogs ...</div>
3 <div data-bind="foreach: cats"> ... A List of Cats ...</div>
4 </div>
This is a helper binding that can be used to dump whatever is passed into it, into the browser console. Useful for debugging and understanding context
1 var hello_world = ko.observable("Hello World");
1 <!-- ko log: hello_world --><!-- /ko -->
1 => Hello World
This is the same as the Knockout's Options binding except that it has been modified to handle Falcon Collection's as well.