Comparing version 0.1.0 to 0.1.1
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -21,26 +21,28 @@ exports.FcCallTag = undefined; | ||
* @example | ||
* <fc-call></fc-call> | ||
* <fc-call fc-name="ctx.anotherRenderFunction"></fc-call> | ||
*/ | ||
var FcCallTag = exports.FcCallTag = function (_FcTag) { | ||
_inherits(FcCallTag, _FcTag); | ||
_inherits(FcCallTag, _FcTag); | ||
function FcCallTag() { | ||
_classCallCheck(this, FcCallTag); | ||
function FcCallTag() { | ||
_classCallCheck(this, FcCallTag); | ||
return _possibleConstructorReturn(this, (FcCallTag.__proto__ || Object.getPrototypeOf(FcCallTag)).apply(this, arguments)); | ||
} | ||
return _possibleConstructorReturn(this, (FcCallTag.__proto__ || Object.getPrototypeOf(FcCallTag)).apply(this, arguments)); | ||
} | ||
_createClass(FcCallTag, [{ | ||
key: 'startTag', | ||
_createClass(FcCallTag, [{ | ||
key: 'startTag', | ||
/** | ||
* @override FcTag#startTag | ||
*/ | ||
value: function startTag(factory, name, attributes, selfClosing) { | ||
var fnName = attributes.name; | ||
factory.append(fnName + '(__el__, __ctx__);'); | ||
} | ||
}]); | ||
/** | ||
* @override FcTag#startTag | ||
*/ | ||
value: function startTag(factory, name, attributes, selfClosing) { | ||
var fnName = attributes['fc-name']; | ||
if (fnName) { | ||
factory.append(fnName + '(__el__, __ctx__);'); | ||
} | ||
} | ||
}]); | ||
return FcCallTag; | ||
return FcCallTag; | ||
}(_FcTag2.FcTag); |
@@ -45,3 +45,3 @@ # Templating | ||
<ul> | ||
<fc-call name="anotherRenderFunction" /> | ||
<fc-call fc-name="anotherRenderFunction" /> | ||
</ul> | ||
@@ -48,0 +48,0 @@ ``` |
{ | ||
"name": "funclate", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A 'build time' HTML parser + a 'runtime' template engine to patch the DOM incrementally.", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"lint": "jshint src test", | ||
"test:integration": "mocha --compilers js:babel-register test/integration", | ||
"test:integration": "mocha --require babel-register test/integration", | ||
"test:others": "karma start config.karma.js", | ||
@@ -26,0 +26,0 @@ "test": "COVERAGE=true npm run test:others && npm run test:integration", |
@@ -6,3 +6,3 @@ import {FcTag} from './FcTag'; | ||
* @example | ||
* <fc-call></fc-call> | ||
* <fc-call fc-name="ctx.anotherRenderFunction"></fc-call> | ||
*/ | ||
@@ -14,5 +14,7 @@ export class FcCallTag extends FcTag { | ||
startTag(factory, name, attributes, selfClosing) { | ||
let fnName = attributes.name; | ||
factory.append(`${fnName}(__el__, __ctx__);`); | ||
let fnName = attributes['fc-name']; | ||
if (fnName) { | ||
factory.append(`${fnName}(__el__, __ctx__);`); | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
559019
10709