knockout.js - ko commands Embedded in comment tags? -


i trying understand hottowel more.

in ~/app/views/shell.html, contains:

<header>     <!--ko compose: {view: 'nav'} --><!--/ko--> </header> 

are ko commands embedded within html comment tags? if so, compose command , how argument used?

yes. feature of knockoutjs , it's called "virtual elements". main advantage don't have add additional html tags if it's unnecessary. it's useful , it's clean in scenarios. mentioned in few places in knockout documentation i.e.: http://knockoutjs.com/documentation/with-binding.html , http://knockoutjs.com/documentation/custom-bindings-for-virtual-elements.html

as of compose it's custom binding , explained in hottowel readme:

the compose bindings header , footer hard coded in hot towel point nav , footer views, respectively. compose binding section #content bound router module's active item. in other words, when click navigation link corresponding view loaded in area.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -