GithubHelp home page GithubHelp logo

knockout-experiments's Introduction

knockout experiments

knockout.js is a nice MVVM (Model View ViewModel) framework for easily binding values to DOM elements (View), with a small footprint, and is good for rapid prototyping.

You can open the example directly at http://matths.github.io/knockout-experiments/ and look into the source using the developer tools of your favourite browser.

custom elements

It also enables the creation of custom html dom elements (close to web components) with the same kind of binding. (http://knockoutjs.com/documentation/component-custom-elements.html)

my examples so far

I just started building a basic example. So far it offers insights two the following stuff:

  • creation / use of custom elements
  • mode switching (view/edit)
  • custom attributes (knockout.js itself offers just the data-bind attribute for components and the params attribute for custom elements)

using https://github.com/SteveSanderson/ko-custom-elems-test/blob/master/lib/knockout-customElements.js by @SteveSanderson

<editable-label content="{{yourContentVar}}"></editable-label>
  • reuse of custom elements
<name-form firstname="{{firstname}}" lastname="{{lastname}}"></name-form>

applications using knockout.js

I have found that the skype web client is using knockout.js https://web.skype.com/. How cool is that? ;)

knockout-experiments's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

knockout-experiments's Issues

Error When Node Lacks getAttribute Method

First off, thanks for providing this library (the Knockout people were clearly smoking something when they came up with the params= syntax). You rock.

However, when I first tried to use it I got an error in the _nodeIsCustomComponentElement method because one of the nodes passed in (I'm guessing a comment node) did not have that method. Of course, since a node without that method can't possibly be a custom element, I was able to fix the problem by simply adding the following check:

function _nodeIsCustomComponentElement (node) {
    if (!node.getAttribute) return false; // my new line
    var noParams = node.getAttribute('params') === null;

Just thought you might want to add it to the library proper, and since I didn't want to hassle with a pull request for just a single line ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.