Skip to content

Instantly share code, notes, and snippets.

"sampleComponent": {
"prototype": "ui/sample-component.reel",
"properties": {
"element": {"#": "sampleComponent"},
"contentController": {"@": "randomItems"}
}
}
@aadsm
aadsm / gist:5542721
Created May 8, 2013 18:55
addRangeAtPathChangeListener is fired twice under certain conditions
describe("addRangeAtPathChangeListener call count", function () {
it("should call the listener only once", function() {
var object = Montage.create();
var foo = Montage.create();
var spy;
// If I comment one of these two lines the test passes because
// the twoway rangeContent() binding doesn't have any effect
foo._array = [];
foo.array = [];
@aadsm
aadsm / gist:5543418
Created May 8, 2013 20:32
rangeContent() two way binding issue
var foo = Montage.create();
foo.array = [];
foo.defineBinding("_array.rangeContent()", {
"<->": "array.rangeContent()"
});
foo.array = [1];
expect(foo.array).toEqual([1]);
---
layout: api
title: "Substitution - MontageJS API"
---
<nav class="subnav js-api-subnav">
<input id="index-search" type="search" placeholder="Search"><details open><summary>Types</summary><ul><li><a href="AbstractButton.html">AbstractButton</a></li><li><a href="AbstractCheckbox.html">AbstractCheckbox</a></li><li><a href="AbstractControl.html">AbstractControl</a></li><li><a href="AbstractImage.html">AbstractImage</a></li><li><a href="AbstractLink.html">AbstractLink</a></li><li><a href="AbstractNumberField.html">AbstractNumberField</a></li><li><a href="AbstractRadioButton.html">AbstractRadioButton</a></li><li><a href="AbstractSelect.html">AbstractSelect</a></li><li><a href="AbstractSlider.html">AbstractSlider</a></li><li><a href="AbstractTextArea.html">AbstractTextArea</a></li><li><a href="AbstractTextField.html">AbstractTextField</a></li><li><a href="AbstractToggleButton.html">AbstractToggleButton</a></li><li><a href="AbstractToggleSwitch.html">AbstractToggleSwitch</a></li><li><a href="AbstractVideo.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>
Main
</title>
<link rel="stylesheet" type="text/css" href="main.css">
<script type="text/montage-serialization">
{
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script type="text/montage-serialization">{
":iteration": {
"alias": "@repetition:iteration"
},
"owner": {
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Main</title>
<script type="text/montage-serialization">
{
"owner": {
"prototype": "ui/main.reel",
"properties": {
#rightCol {
display: none;
}
#contentArea {
width: 786px !important;
}
@aadsm
aadsm / index.css
Created June 6, 2014 21:58
AngularJS animated-boxes
p {
font: 12px/16px Arial;
margin: 10px 10px 15px;
}
button {
font: bold 14px/14px Arial;
margin-left: 10px;
}
@aadsm
aadsm / index.css
Created June 6, 2014 22:21
EmberJS animate-boxes
p {
font: 12px/16px Arial;
margin: 10px 10px 15px;
}
button {
font: bold 14px/14px Arial;
margin-left: 10px;
}