Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionnalities to switch between templateEngine and set custom binding attribute name #2202

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

quentinsup
Copy link

Hi,

Here two functionnalities with minor changes.

  • Use multi-templateEngine

As it is only possible to have only one templateEngine, i've add a functionnality to define which templateEngine using a contentType description.

<script id="template-test" type="text/ko-template"> // use native templating </script>

<script id="template-test" type="text/jquery-tmpl"> // use jquery-tmpl </script>

<script id="template-test" type="text/custom-tmpl"> // use a custom templateEngine with "text/custom-tmpl" as contentType </script>

The way to set the global templateEngine is still the same (as jquery-tmpl autoset if exists)

  • Personnalize data binding attribute name

As default knockout binding attribute name is 'data-bind', i've add a way to modify it and use another attribute name, through bindingProvider method

ko.bindingProvider.instance.setBindingAttributeName('data-app');

<input data-app="..." />

I'm waiting for your feedback !

Add TemplateEngineContentType which can switch templateEngine depends on a contentType
Use text/ko-template to define the nativeTemplateEngine
Use text/jquery-tmpl to use this templateEngine
setBindingAttributeName of the bindingProvider instance can change default data binding attribute 'data-bind'
Take account the data binding attribute name set from bindingProvider
Remove trailing spaces
Remove trailing spaces
Remove trailing spaces
Remove trailing spaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant