Knockout: Alias "data-bind" to "db" or sth shorter

Created on 11 Feb 2018  路  7Comments  路  Source: knockout/knockout

as desc in title

Most helpful comment

I believe the purpose of the data-* format is that's what the HTML spec recommends for those types of attributes.

All 7 comments

I believe the purpose of the data-* format is that's what the HTML spec recommends for those types of attributes.

related: #2202

Incidentally, this will be fairly straightforward in tko with a custom build.

HTML5 compliance require the attribute name starts with data-.

Anyway, I tried VUE.js and its binding starts with v- and I don't like them. Just a personal preference.

I don't mind as much the data- attributes as I do the syntax for passing observables and actions. Be nice to be able to just do data-click or data-css which I think my actually be in tko....correct me if I'm wrong @brianmhunt

@codymullins Yes it is, but it's not turned on or documented or especially well tested. It's on my TODO for shortly after we fix all the knockout-3.4/5 tests.

I like the idea. Angularjs use ng-whatever. Vue use v-whatever. Knockoutjs should use ko-whatever or db-whatever.

Was this page helpful?
0 / 5 - 0 ratings