From 414e80a1c99ac1f696c9d813e5978f390144e989 Mon Sep 17 00:00:00 2001 From: ly <26634873@qq.com> Date: Thu, 12 Nov 2015 17:59:15 +0800 Subject: [PATCH 01/17] FIX: document error on master branch according to #839 --- docs/mithril.component.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/mithril.component.md b/docs/mithril.component.md index b6396d7a..2eb70f99 100644 --- a/docs/mithril.component.md +++ b/docs/mithril.component.md @@ -217,9 +217,9 @@ Components can be placed anywhere a regular element can. If you have components ```javascript var App = { - ctrl: function() { + controller: function() { return {data: [1, 2, 3]} - } + }, view: function(ctrl) { return m(".app", [ //pressing the button reverses the list @@ -280,7 +280,7 @@ var TemperatureConverter = { return value - 273.15 }, kelvinToFahrenheit: function(value) { - return (value 9 / 5 * (v - 273.15)) + 32 + return ( 9 / 5 * (value - 273.15)) + 32 } } }, @@ -305,12 +305,12 @@ var ctrl = new TemperatureConverter.controller(); assert(ctrl.kelvinToCelsius(273.15) == 0) //test the template -var tpl = TemperatureConverter.view(null, {value: 273.15}) +var tpl = TemperatureConverter.view(ctrl, {value: 273.15}) assert(tpl.children[1] == 0) //test with real DOM var testRoot = document.createElement("div") -m.render(testRoot, TemperatureConverter.view(null, {value: 273.15})) +m.render(testRoot, TemperatureConverter.view(ctrl, {value: 273.15})) assert(testRoot.innerHTML.indexOf("celsius:0") > -1) ``` @@ -397,14 +397,14 @@ Often, you will want to do some work before the component is unloaded (i.e. clea var MyComponent = { controller: function() { return { - onunload = function() { + onunload : function() { console.log("unloading my component"); } } }, view: function() { return m("div", "test") - }; + } }; m.mount(document.body, MyComponent); From 795f09840403d2c1eaad9ef9c534ca12f62e36ef Mon Sep 17 00:00:00 2001 From: Syaiful Bahri Date: Tue, 29 Dec 2015 09:58:26 +0700 Subject: [PATCH 02/17] Fix onunload test case - the previous test only remove last item on array, but expect all subcomponent's onunload to be called. This PR change it by clear that array. - uncomment previous test case that marked fail. --- test/mithril.mount.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/test/mithril.mount.js b/test/mithril.mount.js index dadf0b9d..275e1c2b 100644 --- a/test/mithril.mount.js +++ b/test/mithril.mount.js @@ -333,12 +333,11 @@ describe("m.mount()", function () { }) })) - list.pop() + list = [] refresh(true) - // TODO: These fail. - // expect(spies[1]).to.have.been.called - // expect(spies[2]).to.have.been.called + expect(spies[1]).to.have.been.called + expect(spies[2]).to.have.been.called expect(spies[3]).to.have.been.called }) @@ -374,17 +373,15 @@ describe("m.mount()", function () { }) })) - list.pop() + list = [] refresh(true) - // TODO: These fail. - // expect(spies1[1]).to.have.been.called - // expect(spies1[2]).to.have.been.called + expect(spies1[1]).to.have.been.called + expect(spies1[2]).to.have.been.called expect(spies1[3]).to.have.been.called - // TODO: These fail. - // expect(spies2[1]).to.have.been.called - // expect(spies2[2]).to.have.been.called + expect(spies2[1]).to.have.been.called + expect(spies2[2]).to.have.been.called expect(spies2[3]).to.have.been.called }) From 6a160dc10f1cdffeb01ee45727a687b7bb61388a Mon Sep 17 00:00:00 2001 From: Isiah Meadows Date: Wed, 30 Dec 2015 20:42:57 -0500 Subject: [PATCH 03/17] Degenerify `MithrilRoutes` The routes type doesn't need to be parametrized. It's far too restricting and technically incorrect. --- mithril.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mithril.d.ts b/mithril.d.ts index 56d16901..646116de 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -250,7 +250,7 @@ declare module _mithril { ( rootElement: Element, defaultRoute: string, - routes: MithrilRoutes + routes: MithrilRoutes ): void; /** @@ -668,12 +668,12 @@ declare module _mithril { /** * This represents a key-value mapping linking routes to components. */ - interface MithrilRoutes { + interface MithrilRoutes { /** * The key represents the route. The value represents the corresponding * component. */ - [key: string]: MithrilComponent; + [key: string]: MithrilComponent; } /** From 843a720f52cf555af3f80093cf42a8bb78692438 Mon Sep 17 00:00:00 2001 From: Roger Nesbitt Date: Thu, 31 Dec 2015 11:35:02 +1300 Subject: [PATCH 04/17] Small documentation tweak Use "kB" instead of "kb" and include a space between units and the unit symbol. After discussion with @isiahmeadows, make the size more specific too. --- README.md | 2 +- docs/comparison.md | 2 +- docs/getting-started.md | 2 +- docs/layout/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6ed92eea..c04e8a82 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Mithril is a client-side MVC framework - a tool to organize code in a way that i ### Light-weight -- Only 7kb gzipped, no dependencies +- Only 7.8 kB gzipped, no dependencies - Small API, small learning curve ### Robust diff --git a/docs/comparison.md b/docs/comparison.md index fb24bcdd..649344f3 100644 --- a/docs/comparison.md +++ b/docs/comparison.md @@ -6,7 +6,7 @@ This page aims to provide a comparison between Mithril and some of the most wide ### Code Size -One of the most obvious differences between Mithril and most frameworks is in file size: Mithril is around 7kb gzipped and has no dependencies on other libraries. +One of the most obvious differences between Mithril and most frameworks is in file size: Mithril is around 7.8 kB gzipped and has no dependencies on other libraries. Note that while a small gzipped size can look appealing, that number is often used to "hide the weight" of the uncompressed code: remember that the decompressed Javascript still needs to be parsed and evaluated on every page load, and this cost (which can be in the dozens of milliseconds range for some frameworks in some browsers) cannot be cached. diff --git a/docs/getting-started.md b/docs/getting-started.md index 7ee6f431..aeb0b5c5 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -4,7 +4,7 @@ Mithril is a client-side Javascript MVC framework, i.e. it's a tool to make application code divided into a data layer (called **M**odel), a UI layer (called **V**iew), and a glue layer (called **C**ontroller) -Mithril is around 7kb gzipped thanks to its [small, focused, API](mithril.md). It provides a templating engine with a virtual DOM diff implementation for performant rendering, utilities for high-level modelling via functional composition, as well as support for routing and componentization. +Mithril is around 7.8 kB gzipped thanks to its [small, focused, API](mithril.md). It provides a templating engine with a virtual DOM diff implementation for performant rendering, utilities for high-level modelling via functional composition, as well as support for routing and componentization. The goal of the framework is to make application code discoverable, readable and maintainable, and hopefully help you become an even better developer. diff --git a/docs/layout/index.html b/docs/layout/index.html index b91fedea..379a6bfb 100644 --- a/docs/layout/index.html +++ b/docs/layout/index.html @@ -50,7 +50,7 @@

Light-weight

    -
  • Only 7kb gzipped, no dependencies
  • +
  • Only 7.8 kB gzipped, no dependencies
  • Small API, small learning curve
From 0b9cbd1f8219660fab3783858cc5bc63cccec678 Mon Sep 17 00:00:00 2001 From: John Long Date: Tue, 5 Jan 2016 12:20:40 -0700 Subject: [PATCH 05/17] Moves createContextualFragment into try/catch function --- mithril.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mithril.js b/mithril.js index 2e1153bb..f91a8848 100644 --- a/mithril.js +++ b/mithril.js @@ -622,6 +622,13 @@ var m = (function app(window, undefined) { else if (cached.children.tag) unload(cached.children); } } + function appendTextFragment(parentElement, data) { + try { + parentElement.appendChild($document.createRange().createContextualFragment(data)); + } catch (e) { + parentElement.insertAdjacentHTML("beforeend", data); + } + } function injectHTML(parentElement, index, data) { var nextSibling = parentElement.childNodes[index]; if (nextSibling) { @@ -635,10 +642,7 @@ var m = (function app(window, undefined) { else nextSibling.insertAdjacentHTML("beforebegin", data); } else { - if (window.Range && window.Range.prototype.createContextualFragment) { - parentElement.appendChild($document.createRange().createContextualFragment(data)); - } - else parentElement.insertAdjacentHTML("beforeend", data); + appendTextFragment(parentElement, data); } var nodes = []; while (parentElement.childNodes[index] !== nextSibling) { From 886d796e0b020c7cc02dc59f657c992aed0e54ca Mon Sep 17 00:00:00 2001 From: Joshua Kifer Date: Tue, 5 Jan 2016 11:53:01 -0800 Subject: [PATCH 06/17] Fixed setAttributes for custom components (like Polymer uses) with readonly properties --- mithril.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index 2e1153bb..c6384beb 100644 --- a/mithril.js +++ b/mithril.js @@ -579,7 +579,11 @@ var m = (function app(window, undefined) { //- when using CSS selectors (e.g. `m("[style='']")`), style is used as a string, but it's an object in js else if (attrName in node && attrName !== "list" && attrName !== "style" && attrName !== "form" && attrName !== "type" && attrName !== "width" && attrName !== "height") { //#348 don't set the value if not needed otherwise cursor placement breaks in Chrome - if (tag !== "input" || node[attrName] !== dataAttr) node[attrName] = dataAttr; + try { + if (tag !== "input" || node[attrName] !== dataAttr) node[attrName] = dataAttr; + } catch (e) { + node.setAttribute(attrName, dataAttr); + } } else node.setAttribute(attrName, dataAttr); } From 2cc898877dcc9aaabccbd876cea918b28d25357e Mon Sep 17 00:00:00 2001 From: John Long Date: Tue, 5 Jan 2016 14:25:52 -0700 Subject: [PATCH 07/17] Possibly fixes trust tests --- test/mithril.trust.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/mithril.trust.js b/test/mithril.trust.js index e8679f29..d16bf11b 100644 --- a/test/mithril.trust.js +++ b/test/mithril.trust.js @@ -20,19 +20,19 @@ describe("m.trust()", function () { // FIXME: implement document.createRange().createContextualFragment() in the // mock window for these tests dom(function () { - xit("isn't escaped in m.render()", function () { + it("isn't escaped in m.render()", function () { var root = document.createElement("div") m.render(root, m("div", "a", m.trust("&"), "b")) expect(root.childNodes[0].innerHTML).to.equal("a&b") }) - xit("works with mixed trusted content in div", function () { + it("works with mixed trusted content in div", function () { var root = document.createElement("div") m.render(root, [m.trust("

1

2

"), m("i", "foo")]) expect(root.childNodes[2].tagName).to.equal("I") }) - xit("works with mixed trusted content in text nodes", function () { + it("works with mixed trusted content in text nodes", function () { var root = document.createElement("div") m.render(root, [ m.trust("

1

123

2

"), @@ -43,7 +43,7 @@ describe("m.trust()", function () { // FIXME: this is a bug (trusted string's contents rendered as just // textual contents) - xit("works with mixed trusted content in td", function () { + it("works with mixed trusted content in td", function () { var root = document.createElement("table") root.appendChild(root = document.createElement("tr")) From aad2fc3e33e43118cd6593e2f51f346ed3dbd3c7 Mon Sep 17 00:00:00 2001 From: John Long Date: Tue, 5 Jan 2016 15:03:52 -0700 Subject: [PATCH 08/17] Adds test --- test/mithril.trust.js | 12 ++++++++++++ tests/trust-test.html | 0 2 files changed, 12 insertions(+) create mode 100644 tests/trust-test.html diff --git a/test/mithril.trust.js b/test/mithril.trust.js index d16bf11b..b28316e6 100644 --- a/test/mithril.trust.js +++ b/test/mithril.trust.js @@ -20,6 +20,7 @@ describe("m.trust()", function () { // FIXME: implement document.createRange().createContextualFragment() in the // mock window for these tests dom(function () { + it("isn't escaped in m.render()", function () { var root = document.createElement("div") m.render(root, m("div", "a", m.trust("&"), "b")) @@ -54,5 +55,16 @@ describe("m.trust()", function () { expect(root.childNodes[2].tagName).to.equal("TD") }) + + it("works with trusted content in div", function () { + var root = document.createElement("div") + m.render(root, m('div', [ + m('p', '©'), + m('p', m.trust('©')), + m.trust('©'), + ])) + expect(root.innerHTML).to.equal("

&copy;

©

©
") + }) + }) }) diff --git a/tests/trust-test.html b/tests/trust-test.html new file mode 100644 index 00000000..e69de29b From 1eada0de80cb1c8b88dea3eb510b7c6671cb2971 Mon Sep 17 00:00:00 2001 From: John Long Date: Fri, 8 Jan 2016 08:59:48 -0700 Subject: [PATCH 09/17] Removes FIXME comment --- test/mithril.trust.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/mithril.trust.js b/test/mithril.trust.js index b28316e6..c64adb4c 100644 --- a/test/mithril.trust.js +++ b/test/mithril.trust.js @@ -42,8 +42,6 @@ describe("m.trust()", function () { expect(root.childNodes[3].tagName).to.equal("I") }) - // FIXME: this is a bug (trusted string's contents rendered as just - // textual contents) it("works with mixed trusted content in td", function () { var root = document.createElement("table") root.appendChild(root = document.createElement("tr")) From d770f29e390a97a61c6584a9018e3424e2df78ba Mon Sep 17 00:00:00 2001 From: Max Lang Date: Mon, 11 Jan 2016 17:09:38 -0500 Subject: [PATCH 10/17] update typescript defs to support broader MithrilAttributes --- mithril.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mithril.d.ts b/mithril.d.ts index 646116de..111a9ebc 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -534,6 +534,12 @@ declare module _mithril { * @see MithrilElementConfig */ config?: MithrilElementConfig; + + /** + * Any other virtual element properties including attributes and + * event handlers + */ + [property: string]: any; } /** From 46b18caec66e1b18db4fa82e4b2d40cbe9c39087 Mon Sep 17 00:00:00 2001 From: Cody Phillips Date: Sun, 17 Jan 2016 19:31:17 -0500 Subject: [PATCH 11/17] fix for issue #915 Added undefined check at line 76 to prevent an uncaught type error which was occurring when the class attribute was encountered. --- archive/v0.2.2-rc.1/tools/template-converter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/archive/v0.2.2-rc.1/tools/template-converter.js b/archive/v0.2.2-rc.1/tools/template-converter.js index 55217ba3..f08aa57c 100644 --- a/archive/v0.2.2-rc.1/tools/template-converter.js +++ b/archive/v0.2.2-rc.1/tools/template-converter.js @@ -73,6 +73,7 @@ window.templateConverter = (function () { each(Object.keys(el.attrs).sort(), function (attrName) { if (attrName === "style") return + if(el.attrs[attrName]===undefined) return; virtual += "[" + attrName + "='" virtual += el.attrs[attrName].replace(/'/g, "\\'") + "']" }) From 567d9ebd15635f50ec388f83efd1617f6024a750 Mon Sep 17 00:00:00 2001 From: Jeff Shen Date: Thu, 21 Jan 2016 14:53:44 -0800 Subject: [PATCH 12/17] Cleaned up comment on line 557 Fixed subject-verb agreement --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index 53509d51..89fd7f41 100644 --- a/mithril.js +++ b/mithril.js @@ -554,7 +554,7 @@ var m = (function app(window, undefined) { if (!(attrName in cachedAttrs) || (cachedAttr !== dataAttr)) { cachedAttrs[attrName] = dataAttr; try { - //`config` isn't a real attributes, so ignore it + //`config` isn't a real attribute, so ignore it if (attrName === "config" || attrName === "key") continue; //hook event handlers to the auto-redrawing system else if (isFunction(dataAttr) && attrName.slice(0, 2) === "on") { From a8eb0fb0822d07ff3a01c006dfda6eaa0f1f5e1e Mon Sep 17 00:00:00 2001 From: Isiah Meadows Date: Fri, 22 Jan 2016 08:18:19 -0500 Subject: [PATCH 13/17] Revert "Fix docs error" --- docs/mithril.component.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/mithril.component.md b/docs/mithril.component.md index a17cc907..c89df6df 100644 --- a/docs/mithril.component.md +++ b/docs/mithril.component.md @@ -43,7 +43,7 @@ var MyComponent = { m.mount(document.body, MyComponent) // renders

Hello

into ``` -The optional `controller` function creates an object that may be used in the following recommended ways: +The optional `controller` function creates an object that may be used in the following recommended ways: - It can contain methods meant to be called by a `view`. - It can call model methods directly or from methods inside the resulting object. @@ -211,7 +211,7 @@ var App = { view: function() { return m(".app", [ m("h1", "My App"), - + //nested component m.component(MyComponent, {message: "Hello"}) ]) @@ -246,7 +246,7 @@ var App = { return m(".app", [ //pressing the button reverses the list m("button[type=button]", {onclick: function() {ctrl.data.reverse()}}, "My App"), - + ctrl.data.map(function(item) { //the key ensures the components aren't recreated from scratch, if they merely exchanged places return m.component(MyComponent, {message: "Hello " + item, key: item}) @@ -327,12 +327,12 @@ var ctrl = new TemperatureConverter.controller(); assert(ctrl.kelvinToCelsius(273.15) == 0) //test the template -var tpl = TemperatureConverter.view(ctrl, {value: 273.15}) +var tpl = TemperatureConverter.view(null, {value: 273.15}) assert(tpl.children[1] == 0) //test with real DOM var testRoot = document.createElement("div") -m.render(testRoot, TemperatureConverter.view(ctrl, {value: 273.15})) +m.render(testRoot, TemperatureConverter.view(null, {value: 273.15})) assert(testRoot.innerHTML.indexOf("celsius:0") > -1) ``` @@ -451,7 +451,7 @@ var component = { var unsaved = m.prop(false) return { unsaved: unsaved, - + onunload: function(e) { if (unsaved()) { e.preventDefault() @@ -538,7 +538,7 @@ There are a few other technical caveats when nesting components: 2. Nested components cannot change `m.redraw.strategy` from the controller constructor (but they can from event handlers). It's recommended that you use the [`ctx.retain`](mithril.md#persisting-dom-elements-across-route-changes) flag instead of changing the redraw strategy in controller constructors. 3. The root DOM element in a component's view must not be changed during the lifecycle of the component, otherwise undefined behavior will occur. In other words, don't do this: - + ```javascript var MyComponent = { view: function() { @@ -603,3 +603,4 @@ where: - **returns Component parameterizedComponent** A component with arguments bound + From b218f5156f78202c096c96684943c0c6cb39ccba Mon Sep 17 00:00:00 2001 From: impinball Date: Fri, 22 Jan 2016 08:20:26 -0500 Subject: [PATCH 14/17] Reapply docs fix --- docs/mithril.component.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/mithril.component.md b/docs/mithril.component.md index c89df6df..a17cc907 100644 --- a/docs/mithril.component.md +++ b/docs/mithril.component.md @@ -43,7 +43,7 @@ var MyComponent = { m.mount(document.body, MyComponent) // renders

Hello

into ``` -The optional `controller` function creates an object that may be used in the following recommended ways: +The optional `controller` function creates an object that may be used in the following recommended ways: - It can contain methods meant to be called by a `view`. - It can call model methods directly or from methods inside the resulting object. @@ -211,7 +211,7 @@ var App = { view: function() { return m(".app", [ m("h1", "My App"), - + //nested component m.component(MyComponent, {message: "Hello"}) ]) @@ -246,7 +246,7 @@ var App = { return m(".app", [ //pressing the button reverses the list m("button[type=button]", {onclick: function() {ctrl.data.reverse()}}, "My App"), - + ctrl.data.map(function(item) { //the key ensures the components aren't recreated from scratch, if they merely exchanged places return m.component(MyComponent, {message: "Hello " + item, key: item}) @@ -327,12 +327,12 @@ var ctrl = new TemperatureConverter.controller(); assert(ctrl.kelvinToCelsius(273.15) == 0) //test the template -var tpl = TemperatureConverter.view(null, {value: 273.15}) +var tpl = TemperatureConverter.view(ctrl, {value: 273.15}) assert(tpl.children[1] == 0) //test with real DOM var testRoot = document.createElement("div") -m.render(testRoot, TemperatureConverter.view(null, {value: 273.15})) +m.render(testRoot, TemperatureConverter.view(ctrl, {value: 273.15})) assert(testRoot.innerHTML.indexOf("celsius:0") > -1) ``` @@ -451,7 +451,7 @@ var component = { var unsaved = m.prop(false) return { unsaved: unsaved, - + onunload: function(e) { if (unsaved()) { e.preventDefault() @@ -538,7 +538,7 @@ There are a few other technical caveats when nesting components: 2. Nested components cannot change `m.redraw.strategy` from the controller constructor (but they can from event handlers). It's recommended that you use the [`ctx.retain`](mithril.md#persisting-dom-elements-across-route-changes) flag instead of changing the redraw strategy in controller constructors. 3. The root DOM element in a component's view must not be changed during the lifecycle of the component, otherwise undefined behavior will occur. In other words, don't do this: - + ```javascript var MyComponent = { view: function() { @@ -603,4 +603,3 @@ where: - **returns Component parameterizedComponent** A component with arguments bound - From e083aaac9e831296847b853f186051094ac918e5 Mon Sep 17 00:00:00 2001 From: Luis Felipe Souza Date: Fri, 22 Jan 2016 14:21:41 -0200 Subject: [PATCH 15/17] Issue #938 Fixing typo --- docs/mithril.component.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/mithril.component.md b/docs/mithril.component.md index a17cc907..83928d45 100644 --- a/docs/mithril.component.md +++ b/docs/mithril.component.md @@ -165,8 +165,8 @@ var MyComponent = { m.render(document.body, [ //the two lines below are equivalent - m(component, {data: "world"}), - m.component(component, {data: "world"}) + m(MyComponent, {data: "world"}), + m.component(MyComponent, {data: "world"}) ]) ``` From d6d5bac1646b9b1d86da02996f46daa01cfbc5fd Mon Sep 17 00:00:00 2001 From: impinball Date: Fri, 22 Jan 2016 12:06:29 -0500 Subject: [PATCH 16/17] Ignore the old tests --- .eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintignore b/.eslintignore index ff583c3f..43a0cfc9 100644 --- a/.eslintignore +++ b/.eslintignore @@ -10,3 +10,4 @@ docs/layout/lib # TODO: These are temporary, and need to be eventually enabled. mithril.js +tests From ef5ed9d70c9bdf57d4b73984e32ce58048954fac Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 26 Jan 2016 17:44:07 -0500 Subject: [PATCH 17/17] =?UTF-8?q?fix=20typo:=20contoller=20=E2=86=92=20con?= =?UTF-8?q?troller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/mithril.component.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mithril.component.md b/docs/mithril.component.md index 83928d45..fa03042f 100644 --- a/docs/mithril.component.md +++ b/docs/mithril.component.md @@ -590,7 +590,7 @@ where: - **Component component** - A component is supposed to be an Object with two keys: `controller` and `view`. Each of these should point to a Javascript function. If a contoller is not specified, Mithril will automatically create an empty controller function. + A component is supposed to be an Object with two keys: `controller` and `view`. Each of these should point to a Javascript function. If a controller is not specified, Mithril will automatically create an empty controller function. - **Object attributes**