• Stars
    star
    158
  • Rank 235,999 (Top 5 %)
  • Language
    JavaScript
  • Created over 11 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Knockout.js meets ECMAScript 5 properties

knockout-es5

Knockout.js meets ECMAScript 5 properties. Read the introduction and basic usage guide.

Installation

To use in a bower:

bower install knockout-es5

Or, get a copy of the knockout-es5.min.js file

Then just add a <script> tag referencing at. Be sure to place the reference after your reference to Knockout itself:

<script src='knockout-x.y.z.js'></script>
<script src='knockout-es5.min.js'></script>

If you are using this on the server in Node.js, just require the file as a module:

var ko = require('./knockout-es5');
// Now use ko - it has been enhanced with ES5 features

Version without weakmap in build

  • knockout-es5-clean.js
  • knockout-es5-clean.min.js

This files don't have weakmap shim in code. You have to link weakmap shim or use es6 for it.

Recursive traversal of nested objects

ko.track(nestedObj, { deep: true });

With fields:

ko.track(nestedObj, { deep: true, fields: ['prop1', 'prop2'] });

Selecting of nested fields (e.g. 'prop.nested_prop') are not yet supported. If someone need this feature, please create an issue.

Usage fields prop without deep:

ko.track(obj, { fields: ['prop1', 'prop2'] });

How to build from source

First, install NPM if you don't already have it. It comes with Node.js.

Second, install Grunt globally, if you don't already have it:

npm install -g grunt-cli

Third, use NPM to download all the dependencies for this module:

cd wherever_you_cloned_this_repo
npm install

Now you can build the package (linting and running tests along the way):

grunt

Or you can just run the linting tool and tests:

grunt test

Or you can make Grunt watch for changes to the sources/specs and auto-rebuild after each change:

grunt watch

The browser-ready output files will be dumped at the following locations:

  • dist/knockout-es5.js
  • dist/knockout-es5.min.js

More Repositories

1

Blazor

MOVED: Please see the new repo at https://github.com/aspnet/blazor
C#
1,700
star
2

knockout.mapping

Object mapping plugin for KnockoutJS
JavaScript
546
star
3

knockout-projections

Knockout.js observable arrays get smarter
JavaScript
161
star
4

DeliveryTracker

Sample app as built during my ASP.NET Single Page Applications presentation
JavaScript
88
star
5

GuestbookDemo

Example of combining ASP.NET MVC with SpecFlow and WatiN
C#
72
star
6

generator-ko

JavaScript
64
star
7

Deleporter

Cross-process code injection for ASP.NET
ASP
39
star
8

Node.js-Site-Templates-for-WebMatrix

Gives you site templates for building Node.js applications using Microsoft WebMatrix
JavaScript
33
star
9

ASP.NET-MVC-async-demos

Sample apps using async I/O and C# 5's "await" keyword
JavaScript
33
star
10

nodejs-webmatrix-video-tutorials

Code samples to match the videos at http://blog.stevensanderson.com/2012/07/09/node-js-development-with-webmatrix-2-and-express/
JavaScript
32
star
11

xzwasm

XZ decompression for the browser via WebAssembly
JavaScript
31
star
12

knockout.aspnetmvcdemos

Demo apps combining Knockout.js with ASP.NET MVC
JavaScript
27
star
13

knockout-triage

A simple issue-ranking UI to help with KO triage
JavaScript
24
star
14

fixed-height-layouts-demo

Simple HTML/CSS examples of fixed-height layouts
18
star
15

tekpub-code

Code samples relating to TekPub episodes
JavaScript
14
star
16

HtmlUnit_DemoOnDotNet

Simple example of using HtmlUnit on .NET
C#
14
star
17

ko-custom-elems-test

Experiments with a possible future Knockout feature: dynamically-loaded components
JavaScript
13
star
18

knockout.nuget

NuGet package containing Knockout.js
Batchfile
10
star
19

gulp-requirejs-bundler

Gulp plugin. Wraps gulp-requirejs and adds the ability to emit bundle files and bundle config.
JavaScript
8
star
20

node-ejs-middleware

JavaScript
6
star
21

SimpleMvc4ThemeSpike

Quick, rough example of how MVC 4's DisplayMode API could be use to represent user-selectable themes. **MAY BE DELETED AT ANY TIME**
JavaScript
5
star
22

minibench

A simple harness for benchmarking JavaScript code.
JavaScript
4
star
23

LockScreenWallpaper

C#
2
star
24

TypeSinon

A strongly-typed subset of Sinon for use in TypeScript projects
JavaScript
2
star
25

MacKeyboardFix

Eliminates capslock delay when running Windows under BootCamp
C#
1
star