Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hunterloftis/knockout.namespaces
Namespaces plugin for KnockoutJS
https://github.com/hunterloftis/knockout.namespaces
Last synced: 26 days ago
JSON representation
Namespaces plugin for KnockoutJS
- Host: GitHub
- URL: https://github.com/hunterloftis/knockout.namespaces
- Owner: hunterloftis
- Created: 2011-04-03T17:21:15.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-05-23T23:09:23.000Z (over 13 years ago)
- Last Synced: 2025-01-01T12:22:47.685Z (about 1 month ago)
- Language: JavaScript
- Homepage: knockoutjs.com
- Size: 1.4 MB
- Stars: 57
- Watchers: 2
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-knockout - Namespaces - Namespaces for Knockout.js (Plugins and libraries)
README
# Knockout.namespaces
Multiple [KnockoutJS](http://knockoutjs.com) ViewModels (separated by namespaces).
Compatible with the global namespace as well (standard global 'data-bind' ViewModel).
# Download- [knockout.namespaces-latest.js](https://github.com/hunterloftis/knockout.namespaces/blob/master/build/output/knockout.namespaces-latest.js)
- [knockout.namespaces-latest.debug](https://github.com/hunterloftis/knockout.namespaces/blob/master/build/output/knockout.namespaces-latest.debug.js)# Try
$ git clone git://github.com/hunterloftis/knockout.namespaces.git
$ cd knockout.namespaces/examples
$ open simple.html# Code
...
...
ko.applyBindings(globalViewModel);
ko.applyBindings(userViewModel, 'user');
# Use cases
- Multiple ViewModels
- Ajaxed ViewModels
- Loosely coupled architecture
- Dynamic binding
- Data-bound controls and modules# Templates
Namespaced templates are a work-in-progress. Check out /examples/templates.html.
They work for common use cases, but such actions as nesting multiple templates
of different namespaces together may have unpredictable results. I would love
some help coming up with a solution.
# Related- [Initial pull request](https://github.com/SteveSanderson/knockout/pull/74)
- [Google groups discussion](http://groups.google.com/group/knockoutjs/browse_thread/thread/a2a5489c1e4c40de)
- [Initial groups RFC](http://groups.google.com/group/knockoutjs/browse_thread/thread/5f3802217f896d74/96b37601840a23be?lnk=gst&q=namespaces#96b37601840a23be)