This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function text(value) { | |
nextNode(); | |
const node = renderDOM('#text'); | |
// update | |
// checks for text updates | |
const data = getData(node); | |
if (data.text !== value) { | |
data.text = (value); | |
node.data = value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const matches = function(matchNode, name/*, key */) { | |
const data = getData(matchNode); | |
return name === data.name // && key === data.key; | |
}; | |
function renderDOM(name) { | |
if (currentNode && matches(currentNode, name/*, key */)) { | |
return currentNode; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NODE_DATA_KEY = '__ID_Data__'; | |
class NodeData { | |
// key | |
// attrs | |
constructor(name) { | |
this.name = name; | |
this.text = null; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function renderDOM(name) { | |
const node = name === '#text' ? | |
document.createTextNode('') : | |
document.createElement(name); | |
currentParent.insertBefore(node, currentNode); | |
currentNode = node; | |
return node; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The current nodes being processed | |
let currentNode = null; | |
let currentParent = null; | |
function enterNode() { | |
currentParent = currentNode; | |
currentNode = null; | |
} | |
function nextNode() { | |
currentNode = currentNode ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function anonymous(jit_StaticNodeDebugInfo0,jit_createRenderComponentType1, | |
jit_22,jit_DebugAppView3,jit_14,jit_CD_INIT_VALUE5, | |
jit_createRenderElement6,jit__object_Object_7,jit_inlineInterpolate8,jit_checkBinding9 | |
) { | |
var styles_App = []; | |
var nodeDebugInfos_App0 = [ | |
new jit_StaticNodeDebugInfo0([],null,{}), | |
new jit_StaticNodeDebugInfo0([],null,{}), | |
new jit_StaticNodeDebugInfo0([],null,{}), | |
new jit_StaticNodeDebugInfo0([],null,{}), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ng.probe($0).injector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ng.probe($0).injector.elDef.element |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const apiUrl = new InjectionToken('tree-shakeable apiUrl token', { | |
providedIn: 'root', | |
factory: () => 'someUrl' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class InjectionToken<T> { | |
constructor(protected _desc: string, options?: { | |
providedIn?: Type<any>| 'root' | null, | |
factory: () => T | |
}) {} | |
} |