id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
11,700
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
throwErrorIfNoChangesMode
function throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, oldValue, currValue) { if (checkNoChangesMode) { var msg = "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '" + oldValue + "'. Current value: '" + currValue + "'."; if (creationMode) { msg += " It seems like the view has been created after its parent and its children have been dirty checked." + " Has it been created in a change detection hook ?"; } // TODO: include debug context throw new Error(msg); } }
javascript
function throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, oldValue, currValue) { if (checkNoChangesMode) { var msg = "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '" + oldValue + "'. Current value: '" + currValue + "'."; if (creationMode) { msg += " It seems like the view has been created after its parent and its children have been dirty checked." + " Has it been created in a change detection hook ?"; } // TODO: include debug context throw new Error(msg); } }
[ "function", "throwErrorIfNoChangesMode", "(", "creationMode", ",", "checkNoChangesMode", ",", "oldValue", ",", "currValue", ")", "{", "if", "(", "checkNoChangesMode", ")", "{", "var", "msg", "=", "\"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '\"", "+", "oldValue", "+", "\"'. Current value: '\"", "+", "currValue", "+", "\"'.\"", ";", "if", "(", "creationMode", ")", "{", "msg", "+=", "\" It seems like the view has been created after its parent and its children have been dirty checked.\"", "+", "\" Has it been created in a change detection hook ?\"", ";", "}", "// TODO: include debug context", "throw", "new", "Error", "(", "msg", ")", ";", "}", "}" ]
Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on.
[ "Throws", "an", "ExpressionChangedAfterChecked", "error", "if", "checkNoChanges", "mode", "is", "on", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20041-L20052
11,701
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
flatten$1
function flatten$1(list) { var result = []; var i = 0; while (i < list.length) { var item = list[i]; if (Array.isArray(item)) { if (item.length > 0) { list = item.concat(list.slice(i + 1)); i = 0; } else { i++; } } else { result.push(item); i++; } } return result; }
javascript
function flatten$1(list) { var result = []; var i = 0; while (i < list.length) { var item = list[i]; if (Array.isArray(item)) { if (item.length > 0) { list = item.concat(list.slice(i + 1)); i = 0; } else { i++; } } else { result.push(item); i++; } } return result; }
[ "function", "flatten$1", "(", "list", ")", "{", "var", "result", "=", "[", "]", ";", "var", "i", "=", "0", ";", "while", "(", "i", "<", "list", ".", "length", ")", "{", "var", "item", "=", "list", "[", "i", "]", ";", "if", "(", "Array", ".", "isArray", "(", "item", ")", ")", "{", "if", "(", "item", ".", "length", ">", "0", ")", "{", "list", "=", "item", ".", "concat", "(", "list", ".", "slice", "(", "i", "+", "1", ")", ")", ";", "i", "=", "0", ";", "}", "else", "{", "i", "++", ";", "}", "}", "else", "{", "result", ".", "push", "(", "item", ")", ";", "i", "++", ";", "}", "}", "return", "result", ";", "}" ]
Flattens an array in non-recursive way. Input arrays are not modified.
[ "Flattens", "an", "array", "in", "non", "-", "recursive", "way", ".", "Input", "arrays", "are", "not", "modified", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20169-L20189
11,702
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
loadInternal
function loadInternal(index, arr) { ngDevMode && assertDataInRangeInternal(index + HEADER_OFFSET, arr); return arr[index + HEADER_OFFSET]; }
javascript
function loadInternal(index, arr) { ngDevMode && assertDataInRangeInternal(index + HEADER_OFFSET, arr); return arr[index + HEADER_OFFSET]; }
[ "function", "loadInternal", "(", "index", ",", "arr", ")", "{", "ngDevMode", "&&", "assertDataInRangeInternal", "(", "index", "+", "HEADER_OFFSET", ",", "arr", ")", ";", "return", "arr", "[", "index", "+", "HEADER_OFFSET", "]", ";", "}" ]
Retrieves a value from any `LViewData`.
[ "Retrieves", "a", "value", "from", "any", "LViewData", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20191-L20194
11,703
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getChildLNode
function getChildLNode(node) { if (node.tNode.child) { var viewData = node.tNode.type === 2 /* View */ ? node.data : node.view; return readElementValue(viewData[node.tNode.child.index]); } return null; }
javascript
function getChildLNode(node) { if (node.tNode.child) { var viewData = node.tNode.type === 2 /* View */ ? node.data : node.view; return readElementValue(viewData[node.tNode.child.index]); } return null; }
[ "function", "getChildLNode", "(", "node", ")", "{", "if", "(", "node", ".", "tNode", ".", "child", ")", "{", "var", "viewData", "=", "node", ".", "tNode", ".", "type", "===", "2", "/* View */", "?", "node", ".", "data", ":", "node", ".", "view", ";", "return", "readElementValue", "(", "viewData", "[", "node", ".", "tNode", ".", "child", ".", "index", "]", ")", ";", "}", "return", "null", ";", "}" ]
Retrieves the first child of a given node
[ "Retrieves", "the", "first", "child", "of", "a", "given", "node" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20228-L20234
11,704
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
walkLNodeTree
function walkLNodeTree(startingNode, rootNode, action, renderer, renderParentNode, beforeNode) { var node = startingNode; var projectionNodeIndex = -1; while (node) { var nextNode = null; var parent_1 = renderParentNode ? renderParentNode.native : null; var nodeType = node.tNode.type; if (nodeType === 3 /* Element */) { // Execute the action executeNodeAction(action, renderer, parent_1, node.native, beforeNode); if (node.dynamicLContainerNode) { executeNodeAction(action, renderer, parent_1, node.dynamicLContainerNode.native, beforeNode); } } else if (nodeType === 0 /* Container */) { executeNodeAction(action, renderer, parent_1, node.native, beforeNode); var lContainerNode = node; var childContainerData = lContainerNode.dynamicLContainerNode ? lContainerNode.dynamicLContainerNode.data : lContainerNode.data; if (renderParentNode) { childContainerData[RENDER_PARENT] = renderParentNode; } nextNode = childContainerData[VIEWS].length ? getChildLNode(childContainerData[VIEWS][0]) : null; if (nextNode) { // When the walker enters a container, then the beforeNode has to become the local native // comment node. beforeNode = lContainerNode.dynamicLContainerNode ? lContainerNode.dynamicLContainerNode.native : lContainerNode.native; } } else if (nodeType === 1 /* Projection */) { var componentHost = findComponentHost(node.view); var head = componentHost.tNode.projection[node.tNode.projection]; projectionNodeStack[++projectionNodeIndex] = node; nextNode = head ? componentHost.data[PARENT][head.index] : null; } else { // Otherwise look at the first child nextNode = getChildLNode(node); } if (nextNode === null) { nextNode = getNextLNode(node); // this last node was projected, we need to get back down to its projection node if (nextNode === null && (node.tNode.flags & 8192 /* isProjected */)) { nextNode = getNextLNode(projectionNodeStack[projectionNodeIndex--]); } /** * Find the next node in the LNode tree, taking into account the place where a node is * projected (in the shadow DOM) rather than where it comes from (in the light DOM). * * If there is no sibling node, then it goes to the next sibling of the parent node... * until it reaches rootNode (at which point null is returned). */ while (node && !nextNode) { node = getParentLNode(node); if (node === null || node === rootNode) return null; // When exiting a container, the beforeNode must be restored to the previous value if (!node.tNode.next && nodeType === 0 /* Container */) { beforeNode = node.native; } nextNode = getNextLNode(node); } } node = nextNode; } }
javascript
function walkLNodeTree(startingNode, rootNode, action, renderer, renderParentNode, beforeNode) { var node = startingNode; var projectionNodeIndex = -1; while (node) { var nextNode = null; var parent_1 = renderParentNode ? renderParentNode.native : null; var nodeType = node.tNode.type; if (nodeType === 3 /* Element */) { // Execute the action executeNodeAction(action, renderer, parent_1, node.native, beforeNode); if (node.dynamicLContainerNode) { executeNodeAction(action, renderer, parent_1, node.dynamicLContainerNode.native, beforeNode); } } else if (nodeType === 0 /* Container */) { executeNodeAction(action, renderer, parent_1, node.native, beforeNode); var lContainerNode = node; var childContainerData = lContainerNode.dynamicLContainerNode ? lContainerNode.dynamicLContainerNode.data : lContainerNode.data; if (renderParentNode) { childContainerData[RENDER_PARENT] = renderParentNode; } nextNode = childContainerData[VIEWS].length ? getChildLNode(childContainerData[VIEWS][0]) : null; if (nextNode) { // When the walker enters a container, then the beforeNode has to become the local native // comment node. beforeNode = lContainerNode.dynamicLContainerNode ? lContainerNode.dynamicLContainerNode.native : lContainerNode.native; } } else if (nodeType === 1 /* Projection */) { var componentHost = findComponentHost(node.view); var head = componentHost.tNode.projection[node.tNode.projection]; projectionNodeStack[++projectionNodeIndex] = node; nextNode = head ? componentHost.data[PARENT][head.index] : null; } else { // Otherwise look at the first child nextNode = getChildLNode(node); } if (nextNode === null) { nextNode = getNextLNode(node); // this last node was projected, we need to get back down to its projection node if (nextNode === null && (node.tNode.flags & 8192 /* isProjected */)) { nextNode = getNextLNode(projectionNodeStack[projectionNodeIndex--]); } /** * Find the next node in the LNode tree, taking into account the place where a node is * projected (in the shadow DOM) rather than where it comes from (in the light DOM). * * If there is no sibling node, then it goes to the next sibling of the parent node... * until it reaches rootNode (at which point null is returned). */ while (node && !nextNode) { node = getParentLNode(node); if (node === null || node === rootNode) return null; // When exiting a container, the beforeNode must be restored to the previous value if (!node.tNode.next && nodeType === 0 /* Container */) { beforeNode = node.native; } nextNode = getNextLNode(node); } } node = nextNode; } }
[ "function", "walkLNodeTree", "(", "startingNode", ",", "rootNode", ",", "action", ",", "renderer", ",", "renderParentNode", ",", "beforeNode", ")", "{", "var", "node", "=", "startingNode", ";", "var", "projectionNodeIndex", "=", "-", "1", ";", "while", "(", "node", ")", "{", "var", "nextNode", "=", "null", ";", "var", "parent_1", "=", "renderParentNode", "?", "renderParentNode", ".", "native", ":", "null", ";", "var", "nodeType", "=", "node", ".", "tNode", ".", "type", ";", "if", "(", "nodeType", "===", "3", "/* Element */", ")", "{", "// Execute the action", "executeNodeAction", "(", "action", ",", "renderer", ",", "parent_1", ",", "node", ".", "native", ",", "beforeNode", ")", ";", "if", "(", "node", ".", "dynamicLContainerNode", ")", "{", "executeNodeAction", "(", "action", ",", "renderer", ",", "parent_1", ",", "node", ".", "dynamicLContainerNode", ".", "native", ",", "beforeNode", ")", ";", "}", "}", "else", "if", "(", "nodeType", "===", "0", "/* Container */", ")", "{", "executeNodeAction", "(", "action", ",", "renderer", ",", "parent_1", ",", "node", ".", "native", ",", "beforeNode", ")", ";", "var", "lContainerNode", "=", "node", ";", "var", "childContainerData", "=", "lContainerNode", ".", "dynamicLContainerNode", "?", "lContainerNode", ".", "dynamicLContainerNode", ".", "data", ":", "lContainerNode", ".", "data", ";", "if", "(", "renderParentNode", ")", "{", "childContainerData", "[", "RENDER_PARENT", "]", "=", "renderParentNode", ";", "}", "nextNode", "=", "childContainerData", "[", "VIEWS", "]", ".", "length", "?", "getChildLNode", "(", "childContainerData", "[", "VIEWS", "]", "[", "0", "]", ")", ":", "null", ";", "if", "(", "nextNode", ")", "{", "// When the walker enters a container, then the beforeNode has to become the local native", "// comment node.", "beforeNode", "=", "lContainerNode", ".", "dynamicLContainerNode", "?", "lContainerNode", ".", "dynamicLContainerNode", ".", "native", ":", "lContainerNode", ".", "native", ";", "}", "}", "else", "if", "(", "nodeType", "===", "1", "/* Projection */", ")", "{", "var", "componentHost", "=", "findComponentHost", "(", "node", ".", "view", ")", ";", "var", "head", "=", "componentHost", ".", "tNode", ".", "projection", "[", "node", ".", "tNode", ".", "projection", "]", ";", "projectionNodeStack", "[", "++", "projectionNodeIndex", "]", "=", "node", ";", "nextNode", "=", "head", "?", "componentHost", ".", "data", "[", "PARENT", "]", "[", "head", ".", "index", "]", ":", "null", ";", "}", "else", "{", "// Otherwise look at the first child", "nextNode", "=", "getChildLNode", "(", "node", ")", ";", "}", "if", "(", "nextNode", "===", "null", ")", "{", "nextNode", "=", "getNextLNode", "(", "node", ")", ";", "// this last node was projected, we need to get back down to its projection node", "if", "(", "nextNode", "===", "null", "&&", "(", "node", ".", "tNode", ".", "flags", "&", "8192", "/* isProjected */", ")", ")", "{", "nextNode", "=", "getNextLNode", "(", "projectionNodeStack", "[", "projectionNodeIndex", "--", "]", ")", ";", "}", "/**\n * Find the next node in the LNode tree, taking into account the place where a node is\n * projected (in the shadow DOM) rather than where it comes from (in the light DOM).\n *\n * If there is no sibling node, then it goes to the next sibling of the parent node...\n * until it reaches rootNode (at which point null is returned).\n */", "while", "(", "node", "&&", "!", "nextNode", ")", "{", "node", "=", "getParentLNode", "(", "node", ")", ";", "if", "(", "node", "===", "null", "||", "node", "===", "rootNode", ")", "return", "null", ";", "// When exiting a container, the beforeNode must be restored to the previous value", "if", "(", "!", "node", ".", "tNode", ".", "next", "&&", "nodeType", "===", "0", "/* Container */", ")", "{", "beforeNode", "=", "node", ".", "native", ";", "}", "nextNode", "=", "getNextLNode", "(", "node", ")", ";", "}", "}", "node", "=", "nextNode", ";", "}", "}" ]
Walks a tree of LNodes, applying a transformation on the LElement nodes, either only on the first one found, or on all of them. @param startingNode the node from which the walk is started. @param rootNode the root node considered. This prevents walking past that node. @param action identifies the action to be performed on the LElement nodes. @param renderer the current renderer. @param renderParentNode Optional the render parent node to be set in all LContainerNodes found, required for action modes Insert and Destroy. @param beforeNode Optional the node before which elements should be added, required for action Insert.
[ "Walks", "a", "tree", "of", "LNodes", "applying", "a", "transformation", "on", "the", "LElement", "nodes", "either", "only", "on", "the", "first", "one", "found", "or", "on", "all", "of", "them", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20266-L20335
11,705
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
destroyViewTree
function destroyViewTree(rootView) { // If the view has no children, we can clean it up and return early. if (rootView[TVIEW].childIndex === -1) { return cleanUpView(rootView); } var viewOrContainer = getLViewChild(rootView); while (viewOrContainer) { var next = null; if (viewOrContainer.length >= HEADER_OFFSET) { // If LViewData, traverse down to child. var view = viewOrContainer; if (view[TVIEW].childIndex > -1) next = getLViewChild(view); } else { // If container, traverse down to its first LViewData. var container = viewOrContainer; if (container[VIEWS].length) next = container[VIEWS][0].data; } if (next == null) { // Only clean up view when moving to the side or up, as destroy hooks // should be called in order from the bottom up. while (viewOrContainer && !viewOrContainer[NEXT] && viewOrContainer !== rootView) { cleanUpView(viewOrContainer); viewOrContainer = getParentState(viewOrContainer, rootView); } cleanUpView(viewOrContainer || rootView); next = viewOrContainer && viewOrContainer[NEXT]; } viewOrContainer = next; } }
javascript
function destroyViewTree(rootView) { // If the view has no children, we can clean it up and return early. if (rootView[TVIEW].childIndex === -1) { return cleanUpView(rootView); } var viewOrContainer = getLViewChild(rootView); while (viewOrContainer) { var next = null; if (viewOrContainer.length >= HEADER_OFFSET) { // If LViewData, traverse down to child. var view = viewOrContainer; if (view[TVIEW].childIndex > -1) next = getLViewChild(view); } else { // If container, traverse down to its first LViewData. var container = viewOrContainer; if (container[VIEWS].length) next = container[VIEWS][0].data; } if (next == null) { // Only clean up view when moving to the side or up, as destroy hooks // should be called in order from the bottom up. while (viewOrContainer && !viewOrContainer[NEXT] && viewOrContainer !== rootView) { cleanUpView(viewOrContainer); viewOrContainer = getParentState(viewOrContainer, rootView); } cleanUpView(viewOrContainer || rootView); next = viewOrContainer && viewOrContainer[NEXT]; } viewOrContainer = next; } }
[ "function", "destroyViewTree", "(", "rootView", ")", "{", "// If the view has no children, we can clean it up and return early.", "if", "(", "rootView", "[", "TVIEW", "]", ".", "childIndex", "===", "-", "1", ")", "{", "return", "cleanUpView", "(", "rootView", ")", ";", "}", "var", "viewOrContainer", "=", "getLViewChild", "(", "rootView", ")", ";", "while", "(", "viewOrContainer", ")", "{", "var", "next", "=", "null", ";", "if", "(", "viewOrContainer", ".", "length", ">=", "HEADER_OFFSET", ")", "{", "// If LViewData, traverse down to child.", "var", "view", "=", "viewOrContainer", ";", "if", "(", "view", "[", "TVIEW", "]", ".", "childIndex", ">", "-", "1", ")", "next", "=", "getLViewChild", "(", "view", ")", ";", "}", "else", "{", "// If container, traverse down to its first LViewData.", "var", "container", "=", "viewOrContainer", ";", "if", "(", "container", "[", "VIEWS", "]", ".", "length", ")", "next", "=", "container", "[", "VIEWS", "]", "[", "0", "]", ".", "data", ";", "}", "if", "(", "next", "==", "null", ")", "{", "// Only clean up view when moving to the side or up, as destroy hooks", "// should be called in order from the bottom up.", "while", "(", "viewOrContainer", "&&", "!", "viewOrContainer", "[", "NEXT", "]", "&&", "viewOrContainer", "!==", "rootView", ")", "{", "cleanUpView", "(", "viewOrContainer", ")", ";", "viewOrContainer", "=", "getParentState", "(", "viewOrContainer", ",", "rootView", ")", ";", "}", "cleanUpView", "(", "viewOrContainer", "||", "rootView", ")", ";", "next", "=", "viewOrContainer", "&&", "viewOrContainer", "[", "NEXT", "]", ";", "}", "viewOrContainer", "=", "next", ";", "}", "}" ]
Traverses down and up the tree of views and containers to remove listeners and call onDestroy callbacks. Notes: - Because it's used for onDestroy calls, it needs to be bottom-up. - Must process containers instead of their views to avoid splicing when views are destroyed and re-added. - Using a while loop because it's faster than recursion - Destroy only called on movement to sibling or movement to parent (laterally or up) @param rootView The view to destroy
[ "Traverses", "down", "and", "up", "the", "tree", "of", "views", "and", "containers", "to", "remove", "listeners", "and", "call", "onDestroy", "callbacks", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20401-L20433
11,706
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
insertView
function insertView(container, viewNode, index) { var state = container.data; var views = state[VIEWS]; var lView = viewNode.data; if (index > 0) { // This is a new view, we need to add it to the children. views[index - 1].data[NEXT] = lView; } if (index < views.length) { lView[NEXT] = views[index].data; views.splice(index, 0, viewNode); } else { views.push(viewNode); lView[NEXT] = null; } // Dynamically inserted views need a reference to their parent container'S host so it's // possible to jump from a view to its container's next when walking the node tree. if (viewNode.tNode.index === -1) { lView[CONTAINER_INDEX] = container.tNode.parent.index; viewNode.view = container.view; } // Notify query that a new view has been added if (lView[QUERIES]) { lView[QUERIES].insertView(index); } // Sets the attached flag lView[FLAGS] |= 8 /* Attached */; return viewNode; }
javascript
function insertView(container, viewNode, index) { var state = container.data; var views = state[VIEWS]; var lView = viewNode.data; if (index > 0) { // This is a new view, we need to add it to the children. views[index - 1].data[NEXT] = lView; } if (index < views.length) { lView[NEXT] = views[index].data; views.splice(index, 0, viewNode); } else { views.push(viewNode); lView[NEXT] = null; } // Dynamically inserted views need a reference to their parent container'S host so it's // possible to jump from a view to its container's next when walking the node tree. if (viewNode.tNode.index === -1) { lView[CONTAINER_INDEX] = container.tNode.parent.index; viewNode.view = container.view; } // Notify query that a new view has been added if (lView[QUERIES]) { lView[QUERIES].insertView(index); } // Sets the attached flag lView[FLAGS] |= 8 /* Attached */; return viewNode; }
[ "function", "insertView", "(", "container", ",", "viewNode", ",", "index", ")", "{", "var", "state", "=", "container", ".", "data", ";", "var", "views", "=", "state", "[", "VIEWS", "]", ";", "var", "lView", "=", "viewNode", ".", "data", ";", "if", "(", "index", ">", "0", ")", "{", "// This is a new view, we need to add it to the children.", "views", "[", "index", "-", "1", "]", ".", "data", "[", "NEXT", "]", "=", "lView", ";", "}", "if", "(", "index", "<", "views", ".", "length", ")", "{", "lView", "[", "NEXT", "]", "=", "views", "[", "index", "]", ".", "data", ";", "views", ".", "splice", "(", "index", ",", "0", ",", "viewNode", ")", ";", "}", "else", "{", "views", ".", "push", "(", "viewNode", ")", ";", "lView", "[", "NEXT", "]", "=", "null", ";", "}", "// Dynamically inserted views need a reference to their parent container'S host so it's", "// possible to jump from a view to its container's next when walking the node tree.", "if", "(", "viewNode", ".", "tNode", ".", "index", "===", "-", "1", ")", "{", "lView", "[", "CONTAINER_INDEX", "]", "=", "container", ".", "tNode", ".", "parent", ".", "index", ";", "viewNode", ".", "view", "=", "container", ".", "view", ";", "}", "// Notify query that a new view has been added", "if", "(", "lView", "[", "QUERIES", "]", ")", "{", "lView", "[", "QUERIES", "]", ".", "insertView", "(", "index", ")", ";", "}", "// Sets the attached flag", "lView", "[", "FLAGS", "]", "|=", "8", "/* Attached */", ";", "return", "viewNode", ";", "}" ]
Inserts a view into a container. This adds the view to the container's array of active views in the correct position. It also adds the view's elements to the DOM if the container isn't a root node of another view (in that case, the view's elements will be added when the container's parent view is added later). @param container The container into which the view should be inserted @param viewNode The view to insert @param index The index at which to insert the view @returns The inserted view
[ "Inserts", "a", "view", "into", "a", "container", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20447-L20476
11,707
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
detachView
function detachView(container, removeIndex) { var views = container.data[VIEWS]; var viewNode = views[removeIndex]; if (removeIndex > 0) { views[removeIndex - 1].data[NEXT] = viewNode.data[NEXT]; } views.splice(removeIndex, 1); if (!container.tNode.detached) { addRemoveViewFromContainer(container, viewNode, false); } // Notify query that view has been removed var removedLView = viewNode.data; if (removedLView[QUERIES]) { removedLView[QUERIES].removeView(); } removedLView[CONTAINER_INDEX] = -1; viewNode.view = null; // Unsets the attached flag viewNode.data[FLAGS] &= ~8 /* Attached */; return viewNode; }
javascript
function detachView(container, removeIndex) { var views = container.data[VIEWS]; var viewNode = views[removeIndex]; if (removeIndex > 0) { views[removeIndex - 1].data[NEXT] = viewNode.data[NEXT]; } views.splice(removeIndex, 1); if (!container.tNode.detached) { addRemoveViewFromContainer(container, viewNode, false); } // Notify query that view has been removed var removedLView = viewNode.data; if (removedLView[QUERIES]) { removedLView[QUERIES].removeView(); } removedLView[CONTAINER_INDEX] = -1; viewNode.view = null; // Unsets the attached flag viewNode.data[FLAGS] &= ~8 /* Attached */; return viewNode; }
[ "function", "detachView", "(", "container", ",", "removeIndex", ")", "{", "var", "views", "=", "container", ".", "data", "[", "VIEWS", "]", ";", "var", "viewNode", "=", "views", "[", "removeIndex", "]", ";", "if", "(", "removeIndex", ">", "0", ")", "{", "views", "[", "removeIndex", "-", "1", "]", ".", "data", "[", "NEXT", "]", "=", "viewNode", ".", "data", "[", "NEXT", "]", ";", "}", "views", ".", "splice", "(", "removeIndex", ",", "1", ")", ";", "if", "(", "!", "container", ".", "tNode", ".", "detached", ")", "{", "addRemoveViewFromContainer", "(", "container", ",", "viewNode", ",", "false", ")", ";", "}", "// Notify query that view has been removed", "var", "removedLView", "=", "viewNode", ".", "data", ";", "if", "(", "removedLView", "[", "QUERIES", "]", ")", "{", "removedLView", "[", "QUERIES", "]", ".", "removeView", "(", ")", ";", "}", "removedLView", "[", "CONTAINER_INDEX", "]", "=", "-", "1", ";", "viewNode", ".", "view", "=", "null", ";", "// Unsets the attached flag", "viewNode", ".", "data", "[", "FLAGS", "]", "&=", "~", "8", "/* Attached */", ";", "return", "viewNode", ";", "}" ]
Detaches a view from a container. This method splices the view from the container's array of active views. It also removes the view's elements from the DOM. @param container The container from which to detach a view @param removeIndex The index of the view to detach @returns The detached view
[ "Detaches", "a", "view", "from", "a", "container", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20487-L20507
11,708
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
removeView
function removeView(container, removeIndex) { var viewNode = container.data[VIEWS][removeIndex]; detachView(container, removeIndex); destroyLView(viewNode.data); return viewNode; }
javascript
function removeView(container, removeIndex) { var viewNode = container.data[VIEWS][removeIndex]; detachView(container, removeIndex); destroyLView(viewNode.data); return viewNode; }
[ "function", "removeView", "(", "container", ",", "removeIndex", ")", "{", "var", "viewNode", "=", "container", ".", "data", "[", "VIEWS", "]", "[", "removeIndex", "]", ";", "detachView", "(", "container", ",", "removeIndex", ")", ";", "destroyLView", "(", "viewNode", ".", "data", ")", ";", "return", "viewNode", ";", "}" ]
Removes a view from a container, i.e. detaches it and then destroys the underlying LView. @param container The container from which to remove a view @param removeIndex The index of the view to remove @returns The removed view
[ "Removes", "a", "view", "from", "a", "container", "i", ".", "e", ".", "detaches", "it", "and", "then", "destroys", "the", "underlying", "LView", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20515-L20520
11,709
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getLViewChild
function getLViewChild(viewData) { if (viewData[TVIEW].childIndex === -1) return null; var hostNode = viewData[viewData[TVIEW].childIndex]; return hostNode.data ? hostNode.data : hostNode.dynamicLContainerNode.data; }
javascript
function getLViewChild(viewData) { if (viewData[TVIEW].childIndex === -1) return null; var hostNode = viewData[viewData[TVIEW].childIndex]; return hostNode.data ? hostNode.data : hostNode.dynamicLContainerNode.data; }
[ "function", "getLViewChild", "(", "viewData", ")", "{", "if", "(", "viewData", "[", "TVIEW", "]", ".", "childIndex", "===", "-", "1", ")", "return", "null", ";", "var", "hostNode", "=", "viewData", "[", "viewData", "[", "TVIEW", "]", ".", "childIndex", "]", ";", "return", "hostNode", ".", "data", "?", "hostNode", ".", "data", ":", "hostNode", ".", "dynamicLContainerNode", ".", "data", ";", "}" ]
Gets the child of the given LViewData
[ "Gets", "the", "child", "of", "the", "given", "LViewData" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20522-L20527
11,710
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getParentState
function getParentState(state, rootView) { var node; if ((node = state[HOST_NODE]) && node.tNode.type === 2 /* View */) { // if it's an embedded view, the state needs to go up to the container, in case the // container has a next return getParentLNode(node).data; } else { // otherwise, use parent view for containers or component views return state[PARENT] === rootView ? null : state[PARENT]; } }
javascript
function getParentState(state, rootView) { var node; if ((node = state[HOST_NODE]) && node.tNode.type === 2 /* View */) { // if it's an embedded view, the state needs to go up to the container, in case the // container has a next return getParentLNode(node).data; } else { // otherwise, use parent view for containers or component views return state[PARENT] === rootView ? null : state[PARENT]; } }
[ "function", "getParentState", "(", "state", ",", "rootView", ")", "{", "var", "node", ";", "if", "(", "(", "node", "=", "state", "[", "HOST_NODE", "]", ")", "&&", "node", ".", "tNode", ".", "type", "===", "2", "/* View */", ")", "{", "// if it's an embedded view, the state needs to go up to the container, in case the", "// container has a next", "return", "getParentLNode", "(", "node", ")", ".", "data", ";", "}", "else", "{", "// otherwise, use parent view for containers or component views", "return", "state", "[", "PARENT", "]", "===", "rootView", "?", "null", ":", "state", "[", "PARENT", "]", ";", "}", "}" ]
Determines which LViewOrLContainer to jump to when traversing back up the tree in destroyViewTree. Normally, the view's parent LView should be checked, but in the case of embedded views, the container (which is the view node's parent, but not the LView's parent) needs to be checked for a possible next property. @param state The LViewOrLContainer for which we need a parent state @param rootView The rootView, so we don't propagate too far up the view tree @returns The correct parent LViewOrLContainer
[ "Determines", "which", "LViewOrLContainer", "to", "jump", "to", "when", "traversing", "back", "up", "the", "tree", "in", "destroyViewTree", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20555-L20566
11,711
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
cleanUpView
function cleanUpView(viewOrContainer) { if (viewOrContainer[TVIEW]) { var view = viewOrContainer; removeListeners(view); executeOnDestroys(view); executePipeOnDestroys(view); // For component views only, the local renderer is destroyed as clean up time. if (view[TVIEW].id === -1 && isProceduralRenderer(view[RENDERER])) { ngDevMode && ngDevMode.rendererDestroy++; view[RENDERER].destroy(); } } }
javascript
function cleanUpView(viewOrContainer) { if (viewOrContainer[TVIEW]) { var view = viewOrContainer; removeListeners(view); executeOnDestroys(view); executePipeOnDestroys(view); // For component views only, the local renderer is destroyed as clean up time. if (view[TVIEW].id === -1 && isProceduralRenderer(view[RENDERER])) { ngDevMode && ngDevMode.rendererDestroy++; view[RENDERER].destroy(); } } }
[ "function", "cleanUpView", "(", "viewOrContainer", ")", "{", "if", "(", "viewOrContainer", "[", "TVIEW", "]", ")", "{", "var", "view", "=", "viewOrContainer", ";", "removeListeners", "(", "view", ")", ";", "executeOnDestroys", "(", "view", ")", ";", "executePipeOnDestroys", "(", "view", ")", ";", "// For component views only, the local renderer is destroyed as clean up time.", "if", "(", "view", "[", "TVIEW", "]", ".", "id", "===", "-", "1", "&&", "isProceduralRenderer", "(", "view", "[", "RENDERER", "]", ")", ")", "{", "ngDevMode", "&&", "ngDevMode", ".", "rendererDestroy", "++", ";", "view", "[", "RENDERER", "]", ".", "destroy", "(", ")", ";", "}", "}", "}" ]
Removes all listeners and call all onDestroys in a given view. @param view The LViewData to clean up
[ "Removes", "all", "listeners", "and", "call", "all", "onDestroys", "in", "a", "given", "view", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20572-L20584
11,712
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
removeListeners
function removeListeners(viewData) { var cleanup = viewData[TVIEW].cleanup; if (cleanup != null) { for (var i = 0; i < cleanup.length - 1; i += 2) { if (typeof cleanup[i] === 'string') { // This is a listener with the native renderer var native = readElementValue(viewData[cleanup[i + 1]]).native; var listener = viewData[CLEANUP][cleanup[i + 2]]; native.removeEventListener(cleanup[i], listener, cleanup[i + 3]); i += 2; } else if (typeof cleanup[i] === 'number') { // This is a listener with renderer2 (cleanup fn can be found by index) var cleanupFn = viewData[CLEANUP][cleanup[i]]; cleanupFn(); } else { // This is a cleanup function that is grouped with the index of its context var context = viewData[CLEANUP][cleanup[i + 1]]; cleanup[i].call(context); } } viewData[CLEANUP] = null; } }
javascript
function removeListeners(viewData) { var cleanup = viewData[TVIEW].cleanup; if (cleanup != null) { for (var i = 0; i < cleanup.length - 1; i += 2) { if (typeof cleanup[i] === 'string') { // This is a listener with the native renderer var native = readElementValue(viewData[cleanup[i + 1]]).native; var listener = viewData[CLEANUP][cleanup[i + 2]]; native.removeEventListener(cleanup[i], listener, cleanup[i + 3]); i += 2; } else if (typeof cleanup[i] === 'number') { // This is a listener with renderer2 (cleanup fn can be found by index) var cleanupFn = viewData[CLEANUP][cleanup[i]]; cleanupFn(); } else { // This is a cleanup function that is grouped with the index of its context var context = viewData[CLEANUP][cleanup[i + 1]]; cleanup[i].call(context); } } viewData[CLEANUP] = null; } }
[ "function", "removeListeners", "(", "viewData", ")", "{", "var", "cleanup", "=", "viewData", "[", "TVIEW", "]", ".", "cleanup", ";", "if", "(", "cleanup", "!=", "null", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "cleanup", ".", "length", "-", "1", ";", "i", "+=", "2", ")", "{", "if", "(", "typeof", "cleanup", "[", "i", "]", "===", "'string'", ")", "{", "// This is a listener with the native renderer", "var", "native", "=", "readElementValue", "(", "viewData", "[", "cleanup", "[", "i", "+", "1", "]", "]", ")", ".", "native", ";", "var", "listener", "=", "viewData", "[", "CLEANUP", "]", "[", "cleanup", "[", "i", "+", "2", "]", "]", ";", "native", ".", "removeEventListener", "(", "cleanup", "[", "i", "]", ",", "listener", ",", "cleanup", "[", "i", "+", "3", "]", ")", ";", "i", "+=", "2", ";", "}", "else", "if", "(", "typeof", "cleanup", "[", "i", "]", "===", "'number'", ")", "{", "// This is a listener with renderer2 (cleanup fn can be found by index)", "var", "cleanupFn", "=", "viewData", "[", "CLEANUP", "]", "[", "cleanup", "[", "i", "]", "]", ";", "cleanupFn", "(", ")", ";", "}", "else", "{", "// This is a cleanup function that is grouped with the index of its context", "var", "context", "=", "viewData", "[", "CLEANUP", "]", "[", "cleanup", "[", "i", "+", "1", "]", "]", ";", "cleanup", "[", "i", "]", ".", "call", "(", "context", ")", ";", "}", "}", "viewData", "[", "CLEANUP", "]", "=", "null", ";", "}", "}" ]
Removes listeners and unsubscribes from output subscriptions
[ "Removes", "listeners", "and", "unsubscribes", "from", "output", "subscriptions" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20586-L20610
11,713
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
executeOnDestroys
function executeOnDestroys(view) { var tView = view[TVIEW]; var destroyHooks; if (tView != null && (destroyHooks = tView.destroyHooks) != null) { callHooks(view[DIRECTIVES], destroyHooks); } }
javascript
function executeOnDestroys(view) { var tView = view[TVIEW]; var destroyHooks; if (tView != null && (destroyHooks = tView.destroyHooks) != null) { callHooks(view[DIRECTIVES], destroyHooks); } }
[ "function", "executeOnDestroys", "(", "view", ")", "{", "var", "tView", "=", "view", "[", "TVIEW", "]", ";", "var", "destroyHooks", ";", "if", "(", "tView", "!=", "null", "&&", "(", "destroyHooks", "=", "tView", ".", "destroyHooks", ")", "!=", "null", ")", "{", "callHooks", "(", "view", "[", "DIRECTIVES", "]", ",", "destroyHooks", ")", ";", "}", "}" ]
Calls onDestroy hooks for this view
[ "Calls", "onDestroy", "hooks", "for", "this", "view" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20612-L20618
11,714
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
executePipeOnDestroys
function executePipeOnDestroys(viewData) { var pipeDestroyHooks = viewData[TVIEW] && viewData[TVIEW].pipeDestroyHooks; if (pipeDestroyHooks) { callHooks(viewData, pipeDestroyHooks); } }
javascript
function executePipeOnDestroys(viewData) { var pipeDestroyHooks = viewData[TVIEW] && viewData[TVIEW].pipeDestroyHooks; if (pipeDestroyHooks) { callHooks(viewData, pipeDestroyHooks); } }
[ "function", "executePipeOnDestroys", "(", "viewData", ")", "{", "var", "pipeDestroyHooks", "=", "viewData", "[", "TVIEW", "]", "&&", "viewData", "[", "TVIEW", "]", ".", "pipeDestroyHooks", ";", "if", "(", "pipeDestroyHooks", ")", "{", "callHooks", "(", "viewData", ",", "pipeDestroyHooks", ")", ";", "}", "}" ]
Calls pipe destroy hooks for this view
[ "Calls", "pipe", "destroy", "hooks", "for", "this", "view" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20620-L20625
11,715
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
canInsertNativeNode
function canInsertNativeNode(parent, currentView) { // We can only insert into a Component or View. Any other type should be an Error. ngDevMode && assertNodeOfPossibleTypes(parent, 3 /* Element */, 2 /* View */); if (parent.tNode.type === 3 /* Element */) { // Parent is an element. if (parent.view !== currentView) { // If the Parent view is not the same as current view than we are inserting across // Views. This happens when we insert a root element of the component view into // the component host element and it should always be eager. return true; } // Parent elements can be a component which may have projection. if (parent.data === null) { // Parent is a regular non-component element. We should eagerly insert into it // since we know that this relationship will never be broken. return true; } else { // Parent is a Component. Component's content nodes are not inserted immediately // because they will be projected, and so doing insert at this point would be wasteful. // Since the projection would than move it to its final destination. return false; } } else { // Parent is a View. ngDevMode && assertNodeType(parent, 2 /* View */); // Because we are inserting into a `View` the `View` may be disconnected. var grandParentContainer = getParentLNode(parent); if (grandParentContainer == null) { // The `View` is not inserted into a `Container` we have to delay insertion. return false; } ngDevMode && assertNodeType(grandParentContainer, 0 /* Container */); if (grandParentContainer.data[RENDER_PARENT] == null) { // The parent `Container` itself is disconnected. So we have to delay. return false; } else { // The parent `Container` is in inserted state, so we can eagerly insert into // this location. return true; } } }
javascript
function canInsertNativeNode(parent, currentView) { // We can only insert into a Component or View. Any other type should be an Error. ngDevMode && assertNodeOfPossibleTypes(parent, 3 /* Element */, 2 /* View */); if (parent.tNode.type === 3 /* Element */) { // Parent is an element. if (parent.view !== currentView) { // If the Parent view is not the same as current view than we are inserting across // Views. This happens when we insert a root element of the component view into // the component host element and it should always be eager. return true; } // Parent elements can be a component which may have projection. if (parent.data === null) { // Parent is a regular non-component element. We should eagerly insert into it // since we know that this relationship will never be broken. return true; } else { // Parent is a Component. Component's content nodes are not inserted immediately // because they will be projected, and so doing insert at this point would be wasteful. // Since the projection would than move it to its final destination. return false; } } else { // Parent is a View. ngDevMode && assertNodeType(parent, 2 /* View */); // Because we are inserting into a `View` the `View` may be disconnected. var grandParentContainer = getParentLNode(parent); if (grandParentContainer == null) { // The `View` is not inserted into a `Container` we have to delay insertion. return false; } ngDevMode && assertNodeType(grandParentContainer, 0 /* Container */); if (grandParentContainer.data[RENDER_PARENT] == null) { // The parent `Container` itself is disconnected. So we have to delay. return false; } else { // The parent `Container` is in inserted state, so we can eagerly insert into // this location. return true; } } }
[ "function", "canInsertNativeNode", "(", "parent", ",", "currentView", ")", "{", "// We can only insert into a Component or View. Any other type should be an Error.", "ngDevMode", "&&", "assertNodeOfPossibleTypes", "(", "parent", ",", "3", "/* Element */", ",", "2", "/* View */", ")", ";", "if", "(", "parent", ".", "tNode", ".", "type", "===", "3", "/* Element */", ")", "{", "// Parent is an element.", "if", "(", "parent", ".", "view", "!==", "currentView", ")", "{", "// If the Parent view is not the same as current view than we are inserting across", "// Views. This happens when we insert a root element of the component view into", "// the component host element and it should always be eager.", "return", "true", ";", "}", "// Parent elements can be a component which may have projection.", "if", "(", "parent", ".", "data", "===", "null", ")", "{", "// Parent is a regular non-component element. We should eagerly insert into it", "// since we know that this relationship will never be broken.", "return", "true", ";", "}", "else", "{", "// Parent is a Component. Component's content nodes are not inserted immediately", "// because they will be projected, and so doing insert at this point would be wasteful.", "// Since the projection would than move it to its final destination.", "return", "false", ";", "}", "}", "else", "{", "// Parent is a View.", "ngDevMode", "&&", "assertNodeType", "(", "parent", ",", "2", "/* View */", ")", ";", "// Because we are inserting into a `View` the `View` may be disconnected.", "var", "grandParentContainer", "=", "getParentLNode", "(", "parent", ")", ";", "if", "(", "grandParentContainer", "==", "null", ")", "{", "// The `View` is not inserted into a `Container` we have to delay insertion.", "return", "false", ";", "}", "ngDevMode", "&&", "assertNodeType", "(", "grandParentContainer", ",", "0", "/* Container */", ")", ";", "if", "(", "grandParentContainer", ".", "data", "[", "RENDER_PARENT", "]", "==", "null", ")", "{", "// The parent `Container` itself is disconnected. So we have to delay.", "return", "false", ";", "}", "else", "{", "// The parent `Container` is in inserted state, so we can eagerly insert into", "// this location.", "return", "true", ";", "}", "}", "}" ]
Returns whether a native element can be inserted into the given parent. There are two reasons why we may not be able to insert a element immediately. - Projection: When creating a child content element of a component, we have to skip the insertion because the content of a component will be projected. `<component><content>delayed due to projection</content></component>` - Parent container is disconnected: This can happen when we are inserting a view into parent container, which itself is disconnected. For example the parent container is part of a View which has not be inserted or is mare for projection but has not been inserted into destination. @param parent The parent where the child will be inserted into. @param currentView Current LView being processed. @return boolean Whether the child should be inserted now (or delayed until later).
[ "Returns", "whether", "a", "native", "element", "can", "be", "inserted", "into", "the", "given", "parent", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20644-L20688
11,716
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
appendChild
function appendChild(parent, child, currentView) { if (child !== null && canInsertNativeNode(parent, currentView)) { var renderer = currentView[RENDERER]; if (parent.tNode.type === 2 /* View */) { var container = getParentLNode(parent); var renderParent = container.data[RENDER_PARENT]; var views = container.data[VIEWS]; var index = views.indexOf(parent); var beforeNode = index + 1 < views.length ? (getChildLNode(views[index + 1])).native : container.native; isProceduralRenderer(renderer) ? renderer.insertBefore(renderParent.native, child, beforeNode) : renderParent.native.insertBefore(child, beforeNode, true); } else { isProceduralRenderer(renderer) ? renderer.appendChild(parent.native, child) : parent.native.appendChild(child); } return true; } return false; }
javascript
function appendChild(parent, child, currentView) { if (child !== null && canInsertNativeNode(parent, currentView)) { var renderer = currentView[RENDERER]; if (parent.tNode.type === 2 /* View */) { var container = getParentLNode(parent); var renderParent = container.data[RENDER_PARENT]; var views = container.data[VIEWS]; var index = views.indexOf(parent); var beforeNode = index + 1 < views.length ? (getChildLNode(views[index + 1])).native : container.native; isProceduralRenderer(renderer) ? renderer.insertBefore(renderParent.native, child, beforeNode) : renderParent.native.insertBefore(child, beforeNode, true); } else { isProceduralRenderer(renderer) ? renderer.appendChild(parent.native, child) : parent.native.appendChild(child); } return true; } return false; }
[ "function", "appendChild", "(", "parent", ",", "child", ",", "currentView", ")", "{", "if", "(", "child", "!==", "null", "&&", "canInsertNativeNode", "(", "parent", ",", "currentView", ")", ")", "{", "var", "renderer", "=", "currentView", "[", "RENDERER", "]", ";", "if", "(", "parent", ".", "tNode", ".", "type", "===", "2", "/* View */", ")", "{", "var", "container", "=", "getParentLNode", "(", "parent", ")", ";", "var", "renderParent", "=", "container", ".", "data", "[", "RENDER_PARENT", "]", ";", "var", "views", "=", "container", ".", "data", "[", "VIEWS", "]", ";", "var", "index", "=", "views", ".", "indexOf", "(", "parent", ")", ";", "var", "beforeNode", "=", "index", "+", "1", "<", "views", ".", "length", "?", "(", "getChildLNode", "(", "views", "[", "index", "+", "1", "]", ")", ")", ".", "native", ":", "container", ".", "native", ";", "isProceduralRenderer", "(", "renderer", ")", "?", "renderer", ".", "insertBefore", "(", "renderParent", ".", "native", ",", "child", ",", "beforeNode", ")", ":", "renderParent", ".", "native", ".", "insertBefore", "(", "child", ",", "beforeNode", ",", "true", ")", ";", "}", "else", "{", "isProceduralRenderer", "(", "renderer", ")", "?", "renderer", ".", "appendChild", "(", "parent", ".", "native", ",", "child", ")", ":", "parent", ".", "native", ".", "appendChild", "(", "child", ")", ";", "}", "return", "true", ";", "}", "return", "false", ";", "}" ]
Appends the `child` element to the `parent`. The element insertion might be delayed {@link canInsertNativeNode}. @param parent The parent to which to append the child @param child The child that should be appended @param currentView The current LView @returns Whether or not the child was appended
[ "Appends", "the", "child", "element", "to", "the", "parent", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20699-L20719
11,717
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
removeChild
function removeChild(parent, child, currentView) { if (child !== null && canInsertNativeNode(parent, currentView)) { // We only remove the element if not in View or not projected. var renderer = currentView[RENDERER]; isProceduralRenderer(renderer) ? renderer.removeChild(parent.native, child) : parent.native.removeChild(child); return true; } return false; }
javascript
function removeChild(parent, child, currentView) { if (child !== null && canInsertNativeNode(parent, currentView)) { // We only remove the element if not in View or not projected. var renderer = currentView[RENDERER]; isProceduralRenderer(renderer) ? renderer.removeChild(parent.native, child) : parent.native.removeChild(child); return true; } return false; }
[ "function", "removeChild", "(", "parent", ",", "child", ",", "currentView", ")", "{", "if", "(", "child", "!==", "null", "&&", "canInsertNativeNode", "(", "parent", ",", "currentView", ")", ")", "{", "// We only remove the element if not in View or not projected.", "var", "renderer", "=", "currentView", "[", "RENDERER", "]", ";", "isProceduralRenderer", "(", "renderer", ")", "?", "renderer", ".", "removeChild", "(", "parent", ".", "native", ",", "child", ")", ":", "parent", ".", "native", ".", "removeChild", "(", "child", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Removes the `child` element of the `parent` from the DOM. @param parent The parent from which to remove the child @param child The child that should be removed @param currentView The current LView @returns Whether or not the child was removed
[ "Removes", "the", "child", "element", "of", "the", "parent", "from", "the", "DOM", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20728-L20737
11,718
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
appendProjectedNode
function appendProjectedNode(node, currentParent, currentView, renderParent) { appendChild(currentParent, node.native, currentView); if (node.tNode.type === 0 /* Container */) { // The node we are adding is a container and we are adding it to an element which // is not a component (no more re-projection). // Alternatively a container is projected at the root of a component's template // and can't be re-projected (as not content of any component). // Assign the final projection location in those cases. var lContainer = node.data; lContainer[RENDER_PARENT] = renderParent; var views = lContainer[VIEWS]; for (var i = 0; i < views.length; i++) { addRemoveViewFromContainer(node, views[i], true, node.native); } } if (node.dynamicLContainerNode) { node.dynamicLContainerNode.data[RENDER_PARENT] = renderParent; appendChild(currentParent, node.dynamicLContainerNode.native, currentView); } }
javascript
function appendProjectedNode(node, currentParent, currentView, renderParent) { appendChild(currentParent, node.native, currentView); if (node.tNode.type === 0 /* Container */) { // The node we are adding is a container and we are adding it to an element which // is not a component (no more re-projection). // Alternatively a container is projected at the root of a component's template // and can't be re-projected (as not content of any component). // Assign the final projection location in those cases. var lContainer = node.data; lContainer[RENDER_PARENT] = renderParent; var views = lContainer[VIEWS]; for (var i = 0; i < views.length; i++) { addRemoveViewFromContainer(node, views[i], true, node.native); } } if (node.dynamicLContainerNode) { node.dynamicLContainerNode.data[RENDER_PARENT] = renderParent; appendChild(currentParent, node.dynamicLContainerNode.native, currentView); } }
[ "function", "appendProjectedNode", "(", "node", ",", "currentParent", ",", "currentView", ",", "renderParent", ")", "{", "appendChild", "(", "currentParent", ",", "node", ".", "native", ",", "currentView", ")", ";", "if", "(", "node", ".", "tNode", ".", "type", "===", "0", "/* Container */", ")", "{", "// The node we are adding is a container and we are adding it to an element which", "// is not a component (no more re-projection).", "// Alternatively a container is projected at the root of a component's template", "// and can't be re-projected (as not content of any component).", "// Assign the final projection location in those cases.", "var", "lContainer", "=", "node", ".", "data", ";", "lContainer", "[", "RENDER_PARENT", "]", "=", "renderParent", ";", "var", "views", "=", "lContainer", "[", "VIEWS", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "views", ".", "length", ";", "i", "++", ")", "{", "addRemoveViewFromContainer", "(", "node", ",", "views", "[", "i", "]", ",", "true", ",", "node", ".", "native", ")", ";", "}", "}", "if", "(", "node", ".", "dynamicLContainerNode", ")", "{", "node", ".", "dynamicLContainerNode", ".", "data", "[", "RENDER_PARENT", "]", "=", "renderParent", ";", "appendChild", "(", "currentParent", ",", "node", ".", "dynamicLContainerNode", ".", "native", ",", "currentView", ")", ";", "}", "}" ]
Appends a projected node to the DOM, or in the case of a projected container, appends the nodes from all of the container's active views to the DOM. @param node The node to process @param currentParent The last parent element to be processed @param currentView Current LView
[ "Appends", "a", "projected", "node", "to", "the", "DOM", "or", "in", "the", "case", "of", "a", "projected", "container", "appends", "the", "nodes", "from", "all", "of", "the", "container", "s", "active", "views", "to", "the", "DOM", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20746-L20765
11,719
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
isNodeMatchingSelector
function isNodeMatchingSelector(tNode, selector) { ngDevMode && assertDefined(selector[0], 'Selector should have a tag name'); var mode = 4 /* ELEMENT */; var nodeAttrs = tNode.attrs; var selectOnlyMarkerIdx = nodeAttrs ? nodeAttrs.indexOf(1 /* SelectOnly */) : -1; // When processing ":not" selectors, we skip to the next ":not" if the // current one doesn't match var skipToNextSelector = false; for (var i = 0; i < selector.length; i++) { var current = selector[i]; if (typeof current === 'number') { // If we finish processing a :not selector and it hasn't failed, return false if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) { return false; } // If we are skipping to the next :not() and this mode flag is positive, // it's a part of the current :not() selector, and we should keep skipping if (skipToNextSelector && isPositive(current)) continue; skipToNextSelector = false; mode = current | (mode & 1 /* NOT */); continue; } if (skipToNextSelector) continue; if (mode & 4 /* ELEMENT */) { mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */; if (current !== '' && current !== tNode.tagName) { if (isPositive(mode)) return false; skipToNextSelector = true; } } else { var attrName = mode & 8 /* CLASS */ ? 'class' : current; var attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs); if (attrIndexInNode === -1) { if (isPositive(mode)) return false; skipToNextSelector = true; continue; } var selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i]; if (selectorAttrValue !== '') { var nodeAttrValue = void 0; var maybeAttrName = nodeAttrs[attrIndexInNode]; if (selectOnlyMarkerIdx > -1 && attrIndexInNode > selectOnlyMarkerIdx) { nodeAttrValue = ''; } else { ngDevMode && assertNotEqual(maybeAttrName, 0 /* NamespaceURI */, 'We do not match directives on namespaced attributes'); nodeAttrValue = nodeAttrs[attrIndexInNode + 1]; } if (mode & 8 /* CLASS */ && !isCssClassMatching(nodeAttrValue, selectorAttrValue) || mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) { if (isPositive(mode)) return false; skipToNextSelector = true; } } } } return isPositive(mode) || skipToNextSelector; }
javascript
function isNodeMatchingSelector(tNode, selector) { ngDevMode && assertDefined(selector[0], 'Selector should have a tag name'); var mode = 4 /* ELEMENT */; var nodeAttrs = tNode.attrs; var selectOnlyMarkerIdx = nodeAttrs ? nodeAttrs.indexOf(1 /* SelectOnly */) : -1; // When processing ":not" selectors, we skip to the next ":not" if the // current one doesn't match var skipToNextSelector = false; for (var i = 0; i < selector.length; i++) { var current = selector[i]; if (typeof current === 'number') { // If we finish processing a :not selector and it hasn't failed, return false if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) { return false; } // If we are skipping to the next :not() and this mode flag is positive, // it's a part of the current :not() selector, and we should keep skipping if (skipToNextSelector && isPositive(current)) continue; skipToNextSelector = false; mode = current | (mode & 1 /* NOT */); continue; } if (skipToNextSelector) continue; if (mode & 4 /* ELEMENT */) { mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */; if (current !== '' && current !== tNode.tagName) { if (isPositive(mode)) return false; skipToNextSelector = true; } } else { var attrName = mode & 8 /* CLASS */ ? 'class' : current; var attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs); if (attrIndexInNode === -1) { if (isPositive(mode)) return false; skipToNextSelector = true; continue; } var selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i]; if (selectorAttrValue !== '') { var nodeAttrValue = void 0; var maybeAttrName = nodeAttrs[attrIndexInNode]; if (selectOnlyMarkerIdx > -1 && attrIndexInNode > selectOnlyMarkerIdx) { nodeAttrValue = ''; } else { ngDevMode && assertNotEqual(maybeAttrName, 0 /* NamespaceURI */, 'We do not match directives on namespaced attributes'); nodeAttrValue = nodeAttrs[attrIndexInNode + 1]; } if (mode & 8 /* CLASS */ && !isCssClassMatching(nodeAttrValue, selectorAttrValue) || mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) { if (isPositive(mode)) return false; skipToNextSelector = true; } } } } return isPositive(mode) || skipToNextSelector; }
[ "function", "isNodeMatchingSelector", "(", "tNode", ",", "selector", ")", "{", "ngDevMode", "&&", "assertDefined", "(", "selector", "[", "0", "]", ",", "'Selector should have a tag name'", ")", ";", "var", "mode", "=", "4", "/* ELEMENT */", ";", "var", "nodeAttrs", "=", "tNode", ".", "attrs", ";", "var", "selectOnlyMarkerIdx", "=", "nodeAttrs", "?", "nodeAttrs", ".", "indexOf", "(", "1", "/* SelectOnly */", ")", ":", "-", "1", ";", "// When processing \":not\" selectors, we skip to the next \":not\" if the", "// current one doesn't match", "var", "skipToNextSelector", "=", "false", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "selector", ".", "length", ";", "i", "++", ")", "{", "var", "current", "=", "selector", "[", "i", "]", ";", "if", "(", "typeof", "current", "===", "'number'", ")", "{", "// If we finish processing a :not selector and it hasn't failed, return false", "if", "(", "!", "skipToNextSelector", "&&", "!", "isPositive", "(", "mode", ")", "&&", "!", "isPositive", "(", "current", ")", ")", "{", "return", "false", ";", "}", "// If we are skipping to the next :not() and this mode flag is positive,", "// it's a part of the current :not() selector, and we should keep skipping", "if", "(", "skipToNextSelector", "&&", "isPositive", "(", "current", ")", ")", "continue", ";", "skipToNextSelector", "=", "false", ";", "mode", "=", "current", "|", "(", "mode", "&", "1", "/* NOT */", ")", ";", "continue", ";", "}", "if", "(", "skipToNextSelector", ")", "continue", ";", "if", "(", "mode", "&", "4", "/* ELEMENT */", ")", "{", "mode", "=", "2", "/* ATTRIBUTE */", "|", "mode", "&", "1", "/* NOT */", ";", "if", "(", "current", "!==", "''", "&&", "current", "!==", "tNode", ".", "tagName", ")", "{", "if", "(", "isPositive", "(", "mode", ")", ")", "return", "false", ";", "skipToNextSelector", "=", "true", ";", "}", "}", "else", "{", "var", "attrName", "=", "mode", "&", "8", "/* CLASS */", "?", "'class'", ":", "current", ";", "var", "attrIndexInNode", "=", "findAttrIndexInNode", "(", "attrName", ",", "nodeAttrs", ")", ";", "if", "(", "attrIndexInNode", "===", "-", "1", ")", "{", "if", "(", "isPositive", "(", "mode", ")", ")", "return", "false", ";", "skipToNextSelector", "=", "true", ";", "continue", ";", "}", "var", "selectorAttrValue", "=", "mode", "&", "8", "/* CLASS */", "?", "current", ":", "selector", "[", "++", "i", "]", ";", "if", "(", "selectorAttrValue", "!==", "''", ")", "{", "var", "nodeAttrValue", "=", "void", "0", ";", "var", "maybeAttrName", "=", "nodeAttrs", "[", "attrIndexInNode", "]", ";", "if", "(", "selectOnlyMarkerIdx", ">", "-", "1", "&&", "attrIndexInNode", ">", "selectOnlyMarkerIdx", ")", "{", "nodeAttrValue", "=", "''", ";", "}", "else", "{", "ngDevMode", "&&", "assertNotEqual", "(", "maybeAttrName", ",", "0", "/* NamespaceURI */", ",", "'We do not match directives on namespaced attributes'", ")", ";", "nodeAttrValue", "=", "nodeAttrs", "[", "attrIndexInNode", "+", "1", "]", ";", "}", "if", "(", "mode", "&", "8", "/* CLASS */", "&&", "!", "isCssClassMatching", "(", "nodeAttrValue", ",", "selectorAttrValue", ")", "||", "mode", "&", "2", "/* ATTRIBUTE */", "&&", "selectorAttrValue", "!==", "nodeAttrValue", ")", "{", "if", "(", "isPositive", "(", "mode", ")", ")", "return", "false", ";", "skipToNextSelector", "=", "true", ";", "}", "}", "}", "}", "return", "isPositive", "(", "mode", ")", "||", "skipToNextSelector", ";", "}" ]
A utility function to match an Ivy node static data against a simple CSS selector @param node static data to match @param selector @returns true if node matches the selector.
[ "A", "utility", "function", "to", "match", "an", "Ivy", "node", "static", "data", "against", "a", "simple", "CSS", "selector" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20794-L20858
11,720
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
findAttrIndexInNode
function findAttrIndexInNode(name, attrs) { if (attrs === null) return -1; var selectOnlyMode = false; var i = 0; while (i < attrs.length) { var maybeAttrName = attrs[i]; if (maybeAttrName === name) { return i; } else if (maybeAttrName === 0 /* NamespaceURI */) { // NOTE(benlesh): will not find namespaced attributes. This is by design. i += 4; } else { if (maybeAttrName === 1 /* SelectOnly */) { selectOnlyMode = true; } i += selectOnlyMode ? 1 : 2; } } return -1; }
javascript
function findAttrIndexInNode(name, attrs) { if (attrs === null) return -1; var selectOnlyMode = false; var i = 0; while (i < attrs.length) { var maybeAttrName = attrs[i]; if (maybeAttrName === name) { return i; } else if (maybeAttrName === 0 /* NamespaceURI */) { // NOTE(benlesh): will not find namespaced attributes. This is by design. i += 4; } else { if (maybeAttrName === 1 /* SelectOnly */) { selectOnlyMode = true; } i += selectOnlyMode ? 1 : 2; } } return -1; }
[ "function", "findAttrIndexInNode", "(", "name", ",", "attrs", ")", "{", "if", "(", "attrs", "===", "null", ")", "return", "-", "1", ";", "var", "selectOnlyMode", "=", "false", ";", "var", "i", "=", "0", ";", "while", "(", "i", "<", "attrs", ".", "length", ")", "{", "var", "maybeAttrName", "=", "attrs", "[", "i", "]", ";", "if", "(", "maybeAttrName", "===", "name", ")", "{", "return", "i", ";", "}", "else", "if", "(", "maybeAttrName", "===", "0", "/* NamespaceURI */", ")", "{", "// NOTE(benlesh): will not find namespaced attributes. This is by design.", "i", "+=", "4", ";", "}", "else", "{", "if", "(", "maybeAttrName", "===", "1", "/* SelectOnly */", ")", "{", "selectOnlyMode", "=", "true", ";", "}", "i", "+=", "selectOnlyMode", "?", "1", ":", "2", ";", "}", "}", "return", "-", "1", ";", "}" ]
Examines an attributes definition array from a node to find the index of the attribute with the specified name. NOTE: Will not find namespaced attributes. @param name the name of the attribute to find @param attrs the attribute array to examine
[ "Examines", "an", "attributes", "definition", "array", "from", "a", "node", "to", "find", "the", "index", "of", "the", "attribute", "with", "the", "specified", "name", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L20871-L20893
11,721
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
renderStyling
function renderStyling(context, renderer, styleStore, classStore) { if (isContextDirty(context)) { var native = context[0 /* ElementPosition */].native; var multiStartIndex = getMultiStartIndex(context); var styleSanitizer = getStyleSanitizer(context); for (var i = 6 /* SingleStylesStartPosition */; i < context.length; i += 3 /* Size */) { // there is no point in rendering styles that have not changed on screen if (isDirty(context, i)) { var prop = getProp(context, i); var value = getValue(context, i); var flag = getPointers(context, i); var isClassBased_6 = flag & 2 /* Class */ ? true : false; var isInSingleRegion = i < multiStartIndex; var valueToApply = value; // VALUE DEFER CASE 1: Use a multi value instead of a null single value // this check implies that a single value was removed and we // should now defer to a multi value and use that (if set). if (isInSingleRegion && !valueExists(valueToApply, isClassBased_6)) { // single values ALWAYS have a reference to a multi index var multiIndex = getMultiOrSingleIndex(flag); valueToApply = getValue(context, multiIndex); } // VALUE DEFER CASE 2: Use the initial value if all else fails (is falsy) // the initial value will always be a string or null, // therefore we can safely adopt it incase there's nothing else // note that this should always be a falsy check since `false` is used // for both class and style comparisons (styles can't be false and false // classes are turned off and should therefore defer to their initial values) if (!valueExists(valueToApply, isClassBased_6)) { valueToApply = getInitialValue(context, flag); } if (isClassBased_6) { setClass(native, prop, valueToApply ? true : false, renderer, classStore); } else { var sanitizer = (flag & 4 /* Sanitize */) ? styleSanitizer : null; setStyle(native, prop, valueToApply, renderer, sanitizer, styleStore); } setDirty(context, i, false); } } setContextDirty(context, false); } }
javascript
function renderStyling(context, renderer, styleStore, classStore) { if (isContextDirty(context)) { var native = context[0 /* ElementPosition */].native; var multiStartIndex = getMultiStartIndex(context); var styleSanitizer = getStyleSanitizer(context); for (var i = 6 /* SingleStylesStartPosition */; i < context.length; i += 3 /* Size */) { // there is no point in rendering styles that have not changed on screen if (isDirty(context, i)) { var prop = getProp(context, i); var value = getValue(context, i); var flag = getPointers(context, i); var isClassBased_6 = flag & 2 /* Class */ ? true : false; var isInSingleRegion = i < multiStartIndex; var valueToApply = value; // VALUE DEFER CASE 1: Use a multi value instead of a null single value // this check implies that a single value was removed and we // should now defer to a multi value and use that (if set). if (isInSingleRegion && !valueExists(valueToApply, isClassBased_6)) { // single values ALWAYS have a reference to a multi index var multiIndex = getMultiOrSingleIndex(flag); valueToApply = getValue(context, multiIndex); } // VALUE DEFER CASE 2: Use the initial value if all else fails (is falsy) // the initial value will always be a string or null, // therefore we can safely adopt it incase there's nothing else // note that this should always be a falsy check since `false` is used // for both class and style comparisons (styles can't be false and false // classes are turned off and should therefore defer to their initial values) if (!valueExists(valueToApply, isClassBased_6)) { valueToApply = getInitialValue(context, flag); } if (isClassBased_6) { setClass(native, prop, valueToApply ? true : false, renderer, classStore); } else { var sanitizer = (flag & 4 /* Sanitize */) ? styleSanitizer : null; setStyle(native, prop, valueToApply, renderer, sanitizer, styleStore); } setDirty(context, i, false); } } setContextDirty(context, false); } }
[ "function", "renderStyling", "(", "context", ",", "renderer", ",", "styleStore", ",", "classStore", ")", "{", "if", "(", "isContextDirty", "(", "context", ")", ")", "{", "var", "native", "=", "context", "[", "0", "/* ElementPosition */", "]", ".", "native", ";", "var", "multiStartIndex", "=", "getMultiStartIndex", "(", "context", ")", ";", "var", "styleSanitizer", "=", "getStyleSanitizer", "(", "context", ")", ";", "for", "(", "var", "i", "=", "6", "/* SingleStylesStartPosition */", ";", "i", "<", "context", ".", "length", ";", "i", "+=", "3", "/* Size */", ")", "{", "// there is no point in rendering styles that have not changed on screen", "if", "(", "isDirty", "(", "context", ",", "i", ")", ")", "{", "var", "prop", "=", "getProp", "(", "context", ",", "i", ")", ";", "var", "value", "=", "getValue", "(", "context", ",", "i", ")", ";", "var", "flag", "=", "getPointers", "(", "context", ",", "i", ")", ";", "var", "isClassBased_6", "=", "flag", "&", "2", "/* Class */", "?", "true", ":", "false", ";", "var", "isInSingleRegion", "=", "i", "<", "multiStartIndex", ";", "var", "valueToApply", "=", "value", ";", "// VALUE DEFER CASE 1: Use a multi value instead of a null single value", "// this check implies that a single value was removed and we", "// should now defer to a multi value and use that (if set).", "if", "(", "isInSingleRegion", "&&", "!", "valueExists", "(", "valueToApply", ",", "isClassBased_6", ")", ")", "{", "// single values ALWAYS have a reference to a multi index", "var", "multiIndex", "=", "getMultiOrSingleIndex", "(", "flag", ")", ";", "valueToApply", "=", "getValue", "(", "context", ",", "multiIndex", ")", ";", "}", "// VALUE DEFER CASE 2: Use the initial value if all else fails (is falsy)", "// the initial value will always be a string or null,", "// therefore we can safely adopt it incase there's nothing else", "// note that this should always be a falsy check since `false` is used", "// for both class and style comparisons (styles can't be false and false", "// classes are turned off and should therefore defer to their initial values)", "if", "(", "!", "valueExists", "(", "valueToApply", ",", "isClassBased_6", ")", ")", "{", "valueToApply", "=", "getInitialValue", "(", "context", ",", "flag", ")", ";", "}", "if", "(", "isClassBased_6", ")", "{", "setClass", "(", "native", ",", "prop", ",", "valueToApply", "?", "true", ":", "false", ",", "renderer", ",", "classStore", ")", ";", "}", "else", "{", "var", "sanitizer", "=", "(", "flag", "&", "4", "/* Sanitize */", ")", "?", "styleSanitizer", ":", "null", ";", "setStyle", "(", "native", ",", "prop", ",", "valueToApply", ",", "renderer", ",", "sanitizer", ",", "styleStore", ")", ";", "}", "setDirty", "(", "context", ",", "i", ",", "false", ")", ";", "}", "}", "setContextDirty", "(", "context", ",", "false", ")", ";", "}", "}" ]
Renders all queued styling using a renderer onto the given element. This function works by rendering any styles (that have been applied using `updateStylingMap`) and any classes (that have been applied using `updateStyleProp`) onto the provided element using the provided renderer. Just before the styles/classes are rendered a final key/value style map will be assembled (if `styleStore` or `classStore` are provided). @param lElement the element that the styles will be rendered on @param context The styling context that will be used to determine what styles will be rendered @param renderer the renderer that will be used to apply the styling @param styleStore if provided, the updated style values will be applied to this key/value map instead of being renderered via the renderer. @param classStore if provided, the updated class values will be applied to this key/value map instead of being renderered via the renderer.
[ "Renders", "all", "queued", "styling", "using", "a", "renderer", "onto", "the", "given", "element", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L21271-L21314
11,722
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
enterView
function enterView(newView, host) { var oldView = viewData; directives = newView && newView[DIRECTIVES]; tView = newView && newView[TVIEW]; creationMode = newView && (newView[FLAGS] & 1 /* CreationMode */) === 1 /* CreationMode */; firstTemplatePass = newView && tView.firstTemplatePass; renderer = newView && newView[RENDERER]; if (host != null) { previousOrParentNode = host; isParent = true; } viewData = newView; currentQueries = newView && newView[QUERIES]; return oldView; }
javascript
function enterView(newView, host) { var oldView = viewData; directives = newView && newView[DIRECTIVES]; tView = newView && newView[TVIEW]; creationMode = newView && (newView[FLAGS] & 1 /* CreationMode */) === 1 /* CreationMode */; firstTemplatePass = newView && tView.firstTemplatePass; renderer = newView && newView[RENDERER]; if (host != null) { previousOrParentNode = host; isParent = true; } viewData = newView; currentQueries = newView && newView[QUERIES]; return oldView; }
[ "function", "enterView", "(", "newView", ",", "host", ")", "{", "var", "oldView", "=", "viewData", ";", "directives", "=", "newView", "&&", "newView", "[", "DIRECTIVES", "]", ";", "tView", "=", "newView", "&&", "newView", "[", "TVIEW", "]", ";", "creationMode", "=", "newView", "&&", "(", "newView", "[", "FLAGS", "]", "&", "1", "/* CreationMode */", ")", "===", "1", "/* CreationMode */", ";", "firstTemplatePass", "=", "newView", "&&", "tView", ".", "firstTemplatePass", ";", "renderer", "=", "newView", "&&", "newView", "[", "RENDERER", "]", ";", "if", "(", "host", "!=", "null", ")", "{", "previousOrParentNode", "=", "host", ";", "isParent", "=", "true", ";", "}", "viewData", "=", "newView", ";", "currentQueries", "=", "newView", "&&", "newView", "[", "QUERIES", "]", ";", "return", "oldView", ";", "}" ]
Swap the current state with a new state. For performance reasons we store the state in the top level of the module. This way we minimize the number of properties to read. Whenever a new view is entered we have to store the state for later, and when the view is exited the state has to be restored @param newView New state to become active @param host Element to which the View is a child of @returns the previous state;
[ "Swap", "the", "current", "state", "with", "a", "new", "state", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L21681-L21695
11,723
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
setHostBindings
function setHostBindings(bindings) { if (bindings != null) { var defs = tView.directives; for (var i = 0; i < bindings.length; i += 2) { var dirIndex = bindings[i]; var def = defs[dirIndex]; def.hostBindings && def.hostBindings(dirIndex, bindings[i + 1]); } } }
javascript
function setHostBindings(bindings) { if (bindings != null) { var defs = tView.directives; for (var i = 0; i < bindings.length; i += 2) { var dirIndex = bindings[i]; var def = defs[dirIndex]; def.hostBindings && def.hostBindings(dirIndex, bindings[i + 1]); } } }
[ "function", "setHostBindings", "(", "bindings", ")", "{", "if", "(", "bindings", "!=", "null", ")", "{", "var", "defs", "=", "tView", ".", "directives", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "bindings", ".", "length", ";", "i", "+=", "2", ")", "{", "var", "dirIndex", "=", "bindings", "[", "i", "]", ";", "var", "def", "=", "defs", "[", "dirIndex", "]", ";", "def", ".", "hostBindings", "&&", "def", ".", "hostBindings", "(", "dirIndex", ",", "bindings", "[", "i", "+", "1", "]", ")", ";", "}", "}", "}" ]
Sets the host bindings for the current view.
[ "Sets", "the", "host", "bindings", "for", "the", "current", "view", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L21738-L21747
11,724
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
refreshContentQueries
function refreshContentQueries(tView) { if (tView.contentQueries != null) { for (var i = 0; i < tView.contentQueries.length; i += 2) { var directiveDefIdx = tView.contentQueries[i]; var directiveDef = tView.directives[directiveDefIdx]; directiveDef.contentQueriesRefresh(directiveDefIdx, tView.contentQueries[i + 1]); } } }
javascript
function refreshContentQueries(tView) { if (tView.contentQueries != null) { for (var i = 0; i < tView.contentQueries.length; i += 2) { var directiveDefIdx = tView.contentQueries[i]; var directiveDef = tView.directives[directiveDefIdx]; directiveDef.contentQueriesRefresh(directiveDefIdx, tView.contentQueries[i + 1]); } } }
[ "function", "refreshContentQueries", "(", "tView", ")", "{", "if", "(", "tView", ".", "contentQueries", "!=", "null", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "tView", ".", "contentQueries", ".", "length", ";", "i", "+=", "2", ")", "{", "var", "directiveDefIdx", "=", "tView", ".", "contentQueries", "[", "i", "]", ";", "var", "directiveDef", "=", "tView", ".", "directives", "[", "directiveDefIdx", "]", ";", "directiveDef", ".", "contentQueriesRefresh", "(", "directiveDefIdx", ",", "tView", ".", "contentQueries", "[", "i", "+", "1", "]", ")", ";", "}", "}", "}" ]
Refreshes content queries for all directives in the given view.
[ "Refreshes", "content", "queries", "for", "all", "directives", "in", "the", "given", "view", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L21749-L21757
11,725
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
refreshChildComponents
function refreshChildComponents(components) { if (components != null) { for (var i = 0; i < components.length; i += 2) { componentRefresh(components[i], components[i + 1]); } } }
javascript
function refreshChildComponents(components) { if (components != null) { for (var i = 0; i < components.length; i += 2) { componentRefresh(components[i], components[i + 1]); } } }
[ "function", "refreshChildComponents", "(", "components", ")", "{", "if", "(", "components", "!=", "null", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "components", ".", "length", ";", "i", "+=", "2", ")", "{", "componentRefresh", "(", "components", "[", "i", "]", ",", "components", "[", "i", "+", "1", "]", ")", ";", "}", "}", "}" ]
Refreshes child components in the current view.
[ "Refreshes", "child", "components", "in", "the", "current", "view", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L21759-L21765
11,726
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
elementCreate
function elementCreate(name, overriddenRenderer) { var native; var rendererToUse = overriddenRenderer || renderer; if (isProceduralRenderer(rendererToUse)) { native = rendererToUse.createElement(name, _currentNamespace); } else { if (_currentNamespace === null) { native = rendererToUse.createElement(name); } else { native = rendererToUse.createElementNS(_currentNamespace, name); } } return native; }
javascript
function elementCreate(name, overriddenRenderer) { var native; var rendererToUse = overriddenRenderer || renderer; if (isProceduralRenderer(rendererToUse)) { native = rendererToUse.createElement(name, _currentNamespace); } else { if (_currentNamespace === null) { native = rendererToUse.createElement(name); } else { native = rendererToUse.createElementNS(_currentNamespace, name); } } return native; }
[ "function", "elementCreate", "(", "name", ",", "overriddenRenderer", ")", "{", "var", "native", ";", "var", "rendererToUse", "=", "overriddenRenderer", "||", "renderer", ";", "if", "(", "isProceduralRenderer", "(", "rendererToUse", ")", ")", "{", "native", "=", "rendererToUse", ".", "createElement", "(", "name", ",", "_currentNamespace", ")", ";", "}", "else", "{", "if", "(", "_currentNamespace", "===", "null", ")", "{", "native", "=", "rendererToUse", ".", "createElement", "(", "name", ")", ";", "}", "else", "{", "native", "=", "rendererToUse", ".", "createElementNS", "(", "_currentNamespace", ",", "name", ")", ";", "}", "}", "return", "native", ";", "}" ]
Creates a native element from a tag name, using a renderer. @param name the tag name @param overriddenRenderer Optional A renderer to override the default one @returns the element created
[ "Creates", "a", "native", "element", "from", "a", "tag", "name", "using", "a", "renderer", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22036-L22051
11,727
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
createDirectivesAndLocals
function createDirectivesAndLocals(localRefs) { var node = previousOrParentNode; if (firstTemplatePass) { ngDevMode && ngDevMode.firstTemplatePass++; cacheMatchingDirectivesForNode(node.tNode, tView, localRefs || null); } else { instantiateDirectivesDirectly(); } saveResolvedLocalsInData(); }
javascript
function createDirectivesAndLocals(localRefs) { var node = previousOrParentNode; if (firstTemplatePass) { ngDevMode && ngDevMode.firstTemplatePass++; cacheMatchingDirectivesForNode(node.tNode, tView, localRefs || null); } else { instantiateDirectivesDirectly(); } saveResolvedLocalsInData(); }
[ "function", "createDirectivesAndLocals", "(", "localRefs", ")", "{", "var", "node", "=", "previousOrParentNode", ";", "if", "(", "firstTemplatePass", ")", "{", "ngDevMode", "&&", "ngDevMode", ".", "firstTemplatePass", "++", ";", "cacheMatchingDirectivesForNode", "(", "node", ".", "tNode", ",", "tView", ",", "localRefs", "||", "null", ")", ";", "}", "else", "{", "instantiateDirectivesDirectly", "(", ")", ";", "}", "saveResolvedLocalsInData", "(", ")", ";", "}" ]
Creates directive instances and populates local refs. @param localRefs Local refs of the current node
[ "Creates", "directive", "instances", "and", "populates", "local", "refs", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22057-L22067
11,728
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
findDirectiveMatches
function findDirectiveMatches(tNode) { var registry = tView.directiveRegistry; var matches = null; if (registry) { for (var i = 0; i < registry.length; i++) { var def = registry[i]; if (isNodeMatchingSelectorList(tNode, def.selectors)) { if (def.template) { if (tNode.flags & 4096 /* isComponent */) throwMultipleComponentError(tNode); tNode.flags = 4096 /* isComponent */; } if (def.diPublic) def.diPublic(def); (matches || (matches = [])).push(def, null); } } } return matches; }
javascript
function findDirectiveMatches(tNode) { var registry = tView.directiveRegistry; var matches = null; if (registry) { for (var i = 0; i < registry.length; i++) { var def = registry[i]; if (isNodeMatchingSelectorList(tNode, def.selectors)) { if (def.template) { if (tNode.flags & 4096 /* isComponent */) throwMultipleComponentError(tNode); tNode.flags = 4096 /* isComponent */; } if (def.diPublic) def.diPublic(def); (matches || (matches = [])).push(def, null); } } } return matches; }
[ "function", "findDirectiveMatches", "(", "tNode", ")", "{", "var", "registry", "=", "tView", ".", "directiveRegistry", ";", "var", "matches", "=", "null", ";", "if", "(", "registry", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "registry", ".", "length", ";", "i", "++", ")", "{", "var", "def", "=", "registry", "[", "i", "]", ";", "if", "(", "isNodeMatchingSelectorList", "(", "tNode", ",", "def", ".", "selectors", ")", ")", "{", "if", "(", "def", ".", "template", ")", "{", "if", "(", "tNode", ".", "flags", "&", "4096", "/* isComponent */", ")", "throwMultipleComponentError", "(", "tNode", ")", ";", "tNode", ".", "flags", "=", "4096", "/* isComponent */", ";", "}", "if", "(", "def", ".", "diPublic", ")", "def", ".", "diPublic", "(", "def", ")", ";", "(", "matches", "||", "(", "matches", "=", "[", "]", ")", ")", ".", "push", "(", "def", ",", "null", ")", ";", "}", "}", "}", "return", "matches", ";", "}" ]
Matches the current node against all available selectors.
[ "Matches", "the", "current", "node", "against", "all", "available", "selectors", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22089-L22108
11,729
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
queueComponentIndexForCheck
function queueComponentIndexForCheck(dirIndex) { if (firstTemplatePass) { (tView.components || (tView.components = [])).push(dirIndex, viewData.length - 1); } }
javascript
function queueComponentIndexForCheck(dirIndex) { if (firstTemplatePass) { (tView.components || (tView.components = [])).push(dirIndex, viewData.length - 1); } }
[ "function", "queueComponentIndexForCheck", "(", "dirIndex", ")", "{", "if", "(", "firstTemplatePass", ")", "{", "(", "tView", ".", "components", "||", "(", "tView", ".", "components", "=", "[", "]", ")", ")", ".", "push", "(", "dirIndex", ",", "viewData", ".", "length", "-", "1", ")", ";", "}", "}" ]
Stores index of component's host element so it will be queued for view refresh during CD.
[ "Stores", "index", "of", "component", "s", "host", "element", "so", "it", "will", "be", "queued", "for", "view", "refresh", "during", "CD", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22123-L22127
11,730
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
queueHostBindingForCheck
function queueHostBindingForCheck(dirIndex) { // Must subtract the header offset because hostBindings functions are generated with // instructions that expect element indices that are NOT adjusted (e.g. elementProperty). ngDevMode && assertEqual(firstTemplatePass, true, 'Should only be called in first template pass.'); (tView.hostBindings || (tView.hostBindings = [])).push(dirIndex, viewData.length - 1 - HEADER_OFFSET); }
javascript
function queueHostBindingForCheck(dirIndex) { // Must subtract the header offset because hostBindings functions are generated with // instructions that expect element indices that are NOT adjusted (e.g. elementProperty). ngDevMode && assertEqual(firstTemplatePass, true, 'Should only be called in first template pass.'); (tView.hostBindings || (tView.hostBindings = [])).push(dirIndex, viewData.length - 1 - HEADER_OFFSET); }
[ "function", "queueHostBindingForCheck", "(", "dirIndex", ")", "{", "// Must subtract the header offset because hostBindings functions are generated with", "// instructions that expect element indices that are NOT adjusted (e.g. elementProperty).", "ngDevMode", "&&", "assertEqual", "(", "firstTemplatePass", ",", "true", ",", "'Should only be called in first template pass.'", ")", ";", "(", "tView", ".", "hostBindings", "||", "(", "tView", ".", "hostBindings", "=", "[", "]", ")", ")", ".", "push", "(", "dirIndex", ",", "viewData", ".", "length", "-", "1", "-", "HEADER_OFFSET", ")", ";", "}" ]
Stores index of directive and host element so it will be queued for binding refresh during CD.
[ "Stores", "index", "of", "directive", "and", "host", "element", "so", "it", "will", "be", "queued", "for", "binding", "refresh", "during", "CD", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22130-L22136
11,731
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
initChangeDetectorIfExisting
function initChangeDetectorIfExisting(injector, instance, view) { if (injector && injector.changeDetectorRef != null) { injector.changeDetectorRef._setComponentContext(view, instance); } }
javascript
function initChangeDetectorIfExisting(injector, instance, view) { if (injector && injector.changeDetectorRef != null) { injector.changeDetectorRef._setComponentContext(view, instance); } }
[ "function", "initChangeDetectorIfExisting", "(", "injector", ",", "instance", ",", "view", ")", "{", "if", "(", "injector", "&&", "injector", ".", "changeDetectorRef", "!=", "null", ")", "{", "injector", ".", "changeDetectorRef", ".", "_setComponentContext", "(", "view", ",", "instance", ")", ";", "}", "}" ]
Sets the context for a ChangeDetectorRef to the given instance.
[ "Sets", "the", "context", "for", "a", "ChangeDetectorRef", "to", "the", "given", "instance", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22138-L22142
11,732
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
instantiateDirectivesDirectly
function instantiateDirectivesDirectly() { var tNode = previousOrParentNode.tNode; var count = tNode.flags & 4095 /* DirectiveCountMask */; if (count > 0) { var start = tNode.flags >> 14 /* DirectiveStartingIndexShift */; var end = start + count; var tDirectives = tView.directives; for (var i = start; i < end; i++) { var def = tDirectives[i]; directiveCreate(i, def.factory(), def); } } }
javascript
function instantiateDirectivesDirectly() { var tNode = previousOrParentNode.tNode; var count = tNode.flags & 4095 /* DirectiveCountMask */; if (count > 0) { var start = tNode.flags >> 14 /* DirectiveStartingIndexShift */; var end = start + count; var tDirectives = tView.directives; for (var i = start; i < end; i++) { var def = tDirectives[i]; directiveCreate(i, def.factory(), def); } } }
[ "function", "instantiateDirectivesDirectly", "(", ")", "{", "var", "tNode", "=", "previousOrParentNode", ".", "tNode", ";", "var", "count", "=", "tNode", ".", "flags", "&", "4095", "/* DirectiveCountMask */", ";", "if", "(", "count", ">", "0", ")", "{", "var", "start", "=", "tNode", ".", "flags", ">>", "14", "/* DirectiveStartingIndexShift */", ";", "var", "end", "=", "start", "+", "count", ";", "var", "tDirectives", "=", "tView", ".", "directives", ";", "for", "(", "var", "i", "=", "start", ";", "i", "<", "end", ";", "i", "++", ")", "{", "var", "def", "=", "tDirectives", "[", "i", "]", ";", "directiveCreate", "(", "i", ",", "def", ".", "factory", "(", ")", ",", "def", ")", ";", "}", "}", "}" ]
This function instantiates the given directives.
[ "This", "function", "instantiates", "the", "given", "directives", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22149-L22161
11,733
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
cacheMatchingLocalNames
function cacheMatchingLocalNames(tNode, localRefs, exportsMap) { if (localRefs) { var localNames = tNode.localNames = []; // Local names must be stored in tNode in the same order that localRefs are defined // in the template to ensure the data is loaded in the same slots as their refs // in the template (for template queries). for (var i = 0; i < localRefs.length; i += 2) { var index = exportsMap[localRefs[i + 1]]; if (index == null) throw new Error("Export of name '" + localRefs[i + 1] + "' not found!"); localNames.push(localRefs[i], index); } } }
javascript
function cacheMatchingLocalNames(tNode, localRefs, exportsMap) { if (localRefs) { var localNames = tNode.localNames = []; // Local names must be stored in tNode in the same order that localRefs are defined // in the template to ensure the data is loaded in the same slots as their refs // in the template (for template queries). for (var i = 0; i < localRefs.length; i += 2) { var index = exportsMap[localRefs[i + 1]]; if (index == null) throw new Error("Export of name '" + localRefs[i + 1] + "' not found!"); localNames.push(localRefs[i], index); } } }
[ "function", "cacheMatchingLocalNames", "(", "tNode", ",", "localRefs", ",", "exportsMap", ")", "{", "if", "(", "localRefs", ")", "{", "var", "localNames", "=", "tNode", ".", "localNames", "=", "[", "]", ";", "// Local names must be stored in tNode in the same order that localRefs are defined", "// in the template to ensure the data is loaded in the same slots as their refs", "// in the template (for template queries).", "for", "(", "var", "i", "=", "0", ";", "i", "<", "localRefs", ".", "length", ";", "i", "+=", "2", ")", "{", "var", "index", "=", "exportsMap", "[", "localRefs", "[", "i", "+", "1", "]", "]", ";", "if", "(", "index", "==", "null", ")", "throw", "new", "Error", "(", "\"Export of name '\"", "+", "localRefs", "[", "i", "+", "1", "]", "+", "\"' not found!\"", ")", ";", "localNames", ".", "push", "(", "localRefs", "[", "i", "]", ",", "index", ")", ";", "}", "}", "}" ]
Caches local names and their matching directive indices for query and template lookups.
[ "Caches", "local", "names", "and", "their", "matching", "directive", "indices", "for", "query", "and", "template", "lookups", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22163-L22176
11,734
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
saveNameToExportMap
function saveNameToExportMap(index, def, exportsMap) { if (exportsMap) { if (def.exportAs) exportsMap[def.exportAs] = index; if (def.template) exportsMap[''] = index; } }
javascript
function saveNameToExportMap(index, def, exportsMap) { if (exportsMap) { if (def.exportAs) exportsMap[def.exportAs] = index; if (def.template) exportsMap[''] = index; } }
[ "function", "saveNameToExportMap", "(", "index", ",", "def", ",", "exportsMap", ")", "{", "if", "(", "exportsMap", ")", "{", "if", "(", "def", ".", "exportAs", ")", "exportsMap", "[", "def", ".", "exportAs", "]", "=", "index", ";", "if", "(", "def", ".", "template", ")", "exportsMap", "[", "''", "]", "=", "index", ";", "}", "}" ]
Builds up an export map as directives are created, so local refs can be quickly mapped to their directive instances.
[ "Builds", "up", "an", "export", "map", "as", "directives", "are", "created", "so", "local", "refs", "can", "be", "quickly", "mapped", "to", "their", "directive", "instances", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22181-L22188
11,735
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getOrCreateTView
function getOrCreateTView(template, directives, pipes, viewQuery) { // TODO(misko): reading `ngPrivateData` here is problematic for two reasons // 1. It is a megamorphic call on each invocation. // 2. For nested embedded views (ngFor inside ngFor) the template instance is per // outer template invocation, which means that no such property will exist // Correct solution is to only put `ngPrivateData` on the Component template // and not on embedded templates. return template.ngPrivateData || (template.ngPrivateData = createTView(-1, template, directives, pipes, viewQuery)); }
javascript
function getOrCreateTView(template, directives, pipes, viewQuery) { // TODO(misko): reading `ngPrivateData` here is problematic for two reasons // 1. It is a megamorphic call on each invocation. // 2. For nested embedded views (ngFor inside ngFor) the template instance is per // outer template invocation, which means that no such property will exist // Correct solution is to only put `ngPrivateData` on the Component template // and not on embedded templates. return template.ngPrivateData || (template.ngPrivateData = createTView(-1, template, directives, pipes, viewQuery)); }
[ "function", "getOrCreateTView", "(", "template", ",", "directives", ",", "pipes", ",", "viewQuery", ")", "{", "// TODO(misko): reading `ngPrivateData` here is problematic for two reasons", "// 1. It is a megamorphic call on each invocation.", "// 2. For nested embedded views (ngFor inside ngFor) the template instance is per", "// outer template invocation, which means that no such property will exist", "// Correct solution is to only put `ngPrivateData` on the Component template", "// and not on embedded templates.", "return", "template", ".", "ngPrivateData", "||", "(", "template", ".", "ngPrivateData", "=", "createTView", "(", "-", "1", ",", "template", ",", "directives", ",", "pipes", ",", "viewQuery", ")", ")", ";", "}" ]
Gets TView from a template function or creates a new TView if it doesn't already exist. @param template The template from which to get static data @param directives Directive defs that should be saved on TView @param pipes Pipe defs that should be saved on TView @returns TView
[ "Gets", "TView", "from", "a", "template", "function", "or", "creates", "a", "new", "TView", "if", "it", "doesn", "t", "already", "exist", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22212-L22221
11,736
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
createTView
function createTView(viewIndex, template, directives, pipes, viewQuery) { ngDevMode && ngDevMode.tView++; return { id: viewIndex, template: template, viewQuery: viewQuery, node: null, data: HEADER_FILLER.slice(), childIndex: -1, bindingStartIndex: -1, directives: null, firstTemplatePass: true, initHooks: null, checkHooks: null, contentHooks: null, contentCheckHooks: null, viewHooks: null, viewCheckHooks: null, destroyHooks: null, pipeDestroyHooks: null, cleanup: null, hostBindings: null, contentQueries: null, components: null, directiveRegistry: typeof directives === 'function' ? directives() : directives, pipeRegistry: typeof pipes === 'function' ? pipes() : pipes, currentMatches: null }; }
javascript
function createTView(viewIndex, template, directives, pipes, viewQuery) { ngDevMode && ngDevMode.tView++; return { id: viewIndex, template: template, viewQuery: viewQuery, node: null, data: HEADER_FILLER.slice(), childIndex: -1, bindingStartIndex: -1, directives: null, firstTemplatePass: true, initHooks: null, checkHooks: null, contentHooks: null, contentCheckHooks: null, viewHooks: null, viewCheckHooks: null, destroyHooks: null, pipeDestroyHooks: null, cleanup: null, hostBindings: null, contentQueries: null, components: null, directiveRegistry: typeof directives === 'function' ? directives() : directives, pipeRegistry: typeof pipes === 'function' ? pipes() : pipes, currentMatches: null }; }
[ "function", "createTView", "(", "viewIndex", ",", "template", ",", "directives", ",", "pipes", ",", "viewQuery", ")", "{", "ngDevMode", "&&", "ngDevMode", ".", "tView", "++", ";", "return", "{", "id", ":", "viewIndex", ",", "template", ":", "template", ",", "viewQuery", ":", "viewQuery", ",", "node", ":", "null", ",", "data", ":", "HEADER_FILLER", ".", "slice", "(", ")", ",", "childIndex", ":", "-", "1", ",", "bindingStartIndex", ":", "-", "1", ",", "directives", ":", "null", ",", "firstTemplatePass", ":", "true", ",", "initHooks", ":", "null", ",", "checkHooks", ":", "null", ",", "contentHooks", ":", "null", ",", "contentCheckHooks", ":", "null", ",", "viewHooks", ":", "null", ",", "viewCheckHooks", ":", "null", ",", "destroyHooks", ":", "null", ",", "pipeDestroyHooks", ":", "null", ",", "cleanup", ":", "null", ",", "hostBindings", ":", "null", ",", "contentQueries", ":", "null", ",", "components", ":", "null", ",", "directiveRegistry", ":", "typeof", "directives", "===", "'function'", "?", "directives", "(", ")", ":", "directives", ",", "pipeRegistry", ":", "typeof", "pipes", "===", "'function'", "?", "pipes", "(", ")", ":", "pipes", ",", "currentMatches", ":", "null", "}", ";", "}" ]
Creates a TView instance @param viewIndex The viewBlockId for inline views, or -1 if it's a component/dynamic @param directives Registry of directives for this view @param pipes Registry of pipes for this view
[ "Creates", "a", "TView", "instance" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22229-L22257
11,737
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
locateHostElement
function locateHostElement(factory, elementOrSelector) { ngDevMode && assertDataInRange(-1); rendererFactory = factory; var defaultRenderer = factory.createRenderer(null, null); var rNode = typeof elementOrSelector === 'string' ? (isProceduralRenderer(defaultRenderer) ? defaultRenderer.selectRootElement(elementOrSelector) : defaultRenderer.querySelector(elementOrSelector)) : elementOrSelector; if (ngDevMode && !rNode) { if (typeof elementOrSelector === 'string') { throw createError('Host node with selector not found:', elementOrSelector); } else { throw createError('Host node is required:', elementOrSelector); } } return rNode; }
javascript
function locateHostElement(factory, elementOrSelector) { ngDevMode && assertDataInRange(-1); rendererFactory = factory; var defaultRenderer = factory.createRenderer(null, null); var rNode = typeof elementOrSelector === 'string' ? (isProceduralRenderer(defaultRenderer) ? defaultRenderer.selectRootElement(elementOrSelector) : defaultRenderer.querySelector(elementOrSelector)) : elementOrSelector; if (ngDevMode && !rNode) { if (typeof elementOrSelector === 'string') { throw createError('Host node with selector not found:', elementOrSelector); } else { throw createError('Host node is required:', elementOrSelector); } } return rNode; }
[ "function", "locateHostElement", "(", "factory", ",", "elementOrSelector", ")", "{", "ngDevMode", "&&", "assertDataInRange", "(", "-", "1", ")", ";", "rendererFactory", "=", "factory", ";", "var", "defaultRenderer", "=", "factory", ".", "createRenderer", "(", "null", ",", "null", ")", ";", "var", "rNode", "=", "typeof", "elementOrSelector", "===", "'string'", "?", "(", "isProceduralRenderer", "(", "defaultRenderer", ")", "?", "defaultRenderer", ".", "selectRootElement", "(", "elementOrSelector", ")", ":", "defaultRenderer", ".", "querySelector", "(", "elementOrSelector", ")", ")", ":", "elementOrSelector", ";", "if", "(", "ngDevMode", "&&", "!", "rNode", ")", "{", "if", "(", "typeof", "elementOrSelector", "===", "'string'", ")", "{", "throw", "createError", "(", "'Host node with selector not found:'", ",", "elementOrSelector", ")", ";", "}", "else", "{", "throw", "createError", "(", "'Host node is required:'", ",", "elementOrSelector", ")", ";", "}", "}", "return", "rNode", ";", "}" ]
Locates the host native element, used for bootstrapping existing nodes into rendering pipeline. @param elementOrSelector Render element or CSS selector to locate the element.
[ "Locates", "the", "host", "native", "element", "used", "for", "bootstrapping", "existing", "nodes", "into", "rendering", "pipeline", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22301-L22319
11,738
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
hostElement
function hostElement(tag, rNode, def, sanitizer) { resetApplicationState(); var node = createLNode(0, 3 /* Element */, rNode, null, null, createLViewData(renderer, getOrCreateTView(def.template, def.directiveDefs, def.pipeDefs, def.viewQuery), null, def.onPush ? 4 /* Dirty */ : 2 /* CheckAlways */, sanitizer)); if (firstTemplatePass) { node.tNode.flags = 4096 /* isComponent */; if (def.diPublic) def.diPublic(def); tView.directives = [def]; } return node; }
javascript
function hostElement(tag, rNode, def, sanitizer) { resetApplicationState(); var node = createLNode(0, 3 /* Element */, rNode, null, null, createLViewData(renderer, getOrCreateTView(def.template, def.directiveDefs, def.pipeDefs, def.viewQuery), null, def.onPush ? 4 /* Dirty */ : 2 /* CheckAlways */, sanitizer)); if (firstTemplatePass) { node.tNode.flags = 4096 /* isComponent */; if (def.diPublic) def.diPublic(def); tView.directives = [def]; } return node; }
[ "function", "hostElement", "(", "tag", ",", "rNode", ",", "def", ",", "sanitizer", ")", "{", "resetApplicationState", "(", ")", ";", "var", "node", "=", "createLNode", "(", "0", ",", "3", "/* Element */", ",", "rNode", ",", "null", ",", "null", ",", "createLViewData", "(", "renderer", ",", "getOrCreateTView", "(", "def", ".", "template", ",", "def", ".", "directiveDefs", ",", "def", ".", "pipeDefs", ",", "def", ".", "viewQuery", ")", ",", "null", ",", "def", ".", "onPush", "?", "4", "/* Dirty */", ":", "2", "/* CheckAlways */", ",", "sanitizer", ")", ")", ";", "if", "(", "firstTemplatePass", ")", "{", "node", ".", "tNode", ".", "flags", "=", "4096", "/* isComponent */", ";", "if", "(", "def", ".", "diPublic", ")", "def", ".", "diPublic", "(", "def", ")", ";", "tView", ".", "directives", "=", "[", "def", "]", ";", "}", "return", "node", ";", "}" ]
Creates the host LNode. @param rNode Render host element. @param def ComponentDef @returns LElementNode created
[ "Creates", "the", "host", "LNode", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22328-L22338
11,739
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
listener
function listener(eventName, listenerFn, useCapture) { if (useCapture === void 0) { useCapture = false; } ngDevMode && assertPreviousIsParent(); var node = previousOrParentNode; var native = node.native; ngDevMode && ngDevMode.rendererAddEventListener++; // In order to match current behavior, native DOM event listeners must be added for all // events (including outputs). if (isProceduralRenderer(renderer)) { var wrappedListener = wrapListenerWithDirtyLogic(viewData, listenerFn); var cleanupFn = renderer.listen(native, eventName, wrappedListener); storeCleanupFn(viewData, cleanupFn); } else { var wrappedListener = wrapListenerWithDirtyAndDefault(viewData, listenerFn); native.addEventListener(eventName, wrappedListener, useCapture); var cleanupInstances = getCleanup(viewData); cleanupInstances.push(wrappedListener); if (firstTemplatePass) { getTViewCleanup(viewData).push(eventName, node.tNode.index, cleanupInstances.length - 1, useCapture); } } var tNode = node.tNode; if (tNode.outputs === undefined) { // if we create TNode here, inputs must be undefined so we know they still need to be // checked tNode.outputs = generatePropertyAliases(node.tNode.flags, 1 /* Output */); } var outputs = tNode.outputs; var outputData; if (outputs && (outputData = outputs[eventName])) { createOutput(outputData, listenerFn); } }
javascript
function listener(eventName, listenerFn, useCapture) { if (useCapture === void 0) { useCapture = false; } ngDevMode && assertPreviousIsParent(); var node = previousOrParentNode; var native = node.native; ngDevMode && ngDevMode.rendererAddEventListener++; // In order to match current behavior, native DOM event listeners must be added for all // events (including outputs). if (isProceduralRenderer(renderer)) { var wrappedListener = wrapListenerWithDirtyLogic(viewData, listenerFn); var cleanupFn = renderer.listen(native, eventName, wrappedListener); storeCleanupFn(viewData, cleanupFn); } else { var wrappedListener = wrapListenerWithDirtyAndDefault(viewData, listenerFn); native.addEventListener(eventName, wrappedListener, useCapture); var cleanupInstances = getCleanup(viewData); cleanupInstances.push(wrappedListener); if (firstTemplatePass) { getTViewCleanup(viewData).push(eventName, node.tNode.index, cleanupInstances.length - 1, useCapture); } } var tNode = node.tNode; if (tNode.outputs === undefined) { // if we create TNode here, inputs must be undefined so we know they still need to be // checked tNode.outputs = generatePropertyAliases(node.tNode.flags, 1 /* Output */); } var outputs = tNode.outputs; var outputData; if (outputs && (outputData = outputs[eventName])) { createOutput(outputData, listenerFn); } }
[ "function", "listener", "(", "eventName", ",", "listenerFn", ",", "useCapture", ")", "{", "if", "(", "useCapture", "===", "void", "0", ")", "{", "useCapture", "=", "false", ";", "}", "ngDevMode", "&&", "assertPreviousIsParent", "(", ")", ";", "var", "node", "=", "previousOrParentNode", ";", "var", "native", "=", "node", ".", "native", ";", "ngDevMode", "&&", "ngDevMode", ".", "rendererAddEventListener", "++", ";", "// In order to match current behavior, native DOM event listeners must be added for all", "// events (including outputs).", "if", "(", "isProceduralRenderer", "(", "renderer", ")", ")", "{", "var", "wrappedListener", "=", "wrapListenerWithDirtyLogic", "(", "viewData", ",", "listenerFn", ")", ";", "var", "cleanupFn", "=", "renderer", ".", "listen", "(", "native", ",", "eventName", ",", "wrappedListener", ")", ";", "storeCleanupFn", "(", "viewData", ",", "cleanupFn", ")", ";", "}", "else", "{", "var", "wrappedListener", "=", "wrapListenerWithDirtyAndDefault", "(", "viewData", ",", "listenerFn", ")", ";", "native", ".", "addEventListener", "(", "eventName", ",", "wrappedListener", ",", "useCapture", ")", ";", "var", "cleanupInstances", "=", "getCleanup", "(", "viewData", ")", ";", "cleanupInstances", ".", "push", "(", "wrappedListener", ")", ";", "if", "(", "firstTemplatePass", ")", "{", "getTViewCleanup", "(", "viewData", ")", ".", "push", "(", "eventName", ",", "node", ".", "tNode", ".", "index", ",", "cleanupInstances", ".", "length", "-", "1", ",", "useCapture", ")", ";", "}", "}", "var", "tNode", "=", "node", ".", "tNode", ";", "if", "(", "tNode", ".", "outputs", "===", "undefined", ")", "{", "// if we create TNode here, inputs must be undefined so we know they still need to be", "// checked", "tNode", ".", "outputs", "=", "generatePropertyAliases", "(", "node", ".", "tNode", ".", "flags", ",", "1", "/* Output */", ")", ";", "}", "var", "outputs", "=", "tNode", ".", "outputs", ";", "var", "outputData", ";", "if", "(", "outputs", "&&", "(", "outputData", "=", "outputs", "[", "eventName", "]", ")", ")", "{", "createOutput", "(", "outputData", ",", "listenerFn", ")", ";", "}", "}" ]
Adds an event listener to the current node. If an output exists on one of the node's directives, it also subscribes to the output and saves the subscription for later cleanup. @param eventName Name of the event @param listenerFn The function to be called when event emits @param useCapture Whether or not to use capture in event listener.
[ "Adds", "an", "event", "listener", "to", "the", "current", "node", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22349-L22382
11,740
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
createOutput
function createOutput(outputs, listener) { for (var i = 0; i < outputs.length; i += 2) { ngDevMode && assertDataInRange(outputs[i], directives); var subscription = directives[outputs[i]][outputs[i + 1]].subscribe(listener); storeCleanupWithContext(viewData, subscription, subscription.unsubscribe); } }
javascript
function createOutput(outputs, listener) { for (var i = 0; i < outputs.length; i += 2) { ngDevMode && assertDataInRange(outputs[i], directives); var subscription = directives[outputs[i]][outputs[i + 1]].subscribe(listener); storeCleanupWithContext(viewData, subscription, subscription.unsubscribe); } }
[ "function", "createOutput", "(", "outputs", ",", "listener", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "outputs", ".", "length", ";", "i", "+=", "2", ")", "{", "ngDevMode", "&&", "assertDataInRange", "(", "outputs", "[", "i", "]", ",", "directives", ")", ";", "var", "subscription", "=", "directives", "[", "outputs", "[", "i", "]", "]", "[", "outputs", "[", "i", "+", "1", "]", "]", ".", "subscribe", "(", "listener", ")", ";", "storeCleanupWithContext", "(", "viewData", ",", "subscription", ",", "subscription", ".", "unsubscribe", ")", ";", "}", "}" ]
Iterates through the outputs associated with a particular event name and subscribes to each output.
[ "Iterates", "through", "the", "outputs", "associated", "with", "a", "particular", "event", "name", "and", "subscribes", "to", "each", "output", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22387-L22393
11,741
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
storeCleanupWithContext
function storeCleanupWithContext(view, context, cleanupFn) { if (!view) view = viewData; getCleanup(view).push(context); if (view[TVIEW].firstTemplatePass) { getTViewCleanup(view).push(cleanupFn, view[CLEANUP].length - 1); } }
javascript
function storeCleanupWithContext(view, context, cleanupFn) { if (!view) view = viewData; getCleanup(view).push(context); if (view[TVIEW].firstTemplatePass) { getTViewCleanup(view).push(cleanupFn, view[CLEANUP].length - 1); } }
[ "function", "storeCleanupWithContext", "(", "view", ",", "context", ",", "cleanupFn", ")", "{", "if", "(", "!", "view", ")", "view", "=", "viewData", ";", "getCleanup", "(", "view", ")", ".", "push", "(", "context", ")", ";", "if", "(", "view", "[", "TVIEW", "]", ".", "firstTemplatePass", ")", "{", "getTViewCleanup", "(", "view", ")", ".", "push", "(", "cleanupFn", ",", "view", "[", "CLEANUP", "]", ".", "length", "-", "1", ")", ";", "}", "}" ]
Saves context for this cleanup function in LView.cleanupInstances. On the first template pass, saves in TView: - Cleanup function - Index of context we just saved in LView.cleanupInstances
[ "Saves", "context", "for", "this", "cleanup", "function", "in", "LView", ".", "cleanupInstances", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22401-L22408
11,742
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
storeCleanupFn
function storeCleanupFn(view, cleanupFn) { getCleanup(view).push(cleanupFn); if (view[TVIEW].firstTemplatePass) { getTViewCleanup(view).push(view[CLEANUP].length - 1, null); } }
javascript
function storeCleanupFn(view, cleanupFn) { getCleanup(view).push(cleanupFn); if (view[TVIEW].firstTemplatePass) { getTViewCleanup(view).push(view[CLEANUP].length - 1, null); } }
[ "function", "storeCleanupFn", "(", "view", ",", "cleanupFn", ")", "{", "getCleanup", "(", "view", ")", ".", "push", "(", "cleanupFn", ")", ";", "if", "(", "view", "[", "TVIEW", "]", ".", "firstTemplatePass", ")", "{", "getTViewCleanup", "(", "view", ")", ".", "push", "(", "view", "[", "CLEANUP", "]", ".", "length", "-", "1", ",", "null", ")", ";", "}", "}" ]
Saves the cleanup function itself in LView.cleanupInstances. This is necessary for functions that are wrapped with their contexts, like in renderer2 listeners. On the first template pass, the index of the cleanup function is saved in TView.
[ "Saves", "the", "cleanup", "function", "itself", "in", "LView", ".", "cleanupInstances", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22417-L22422
11,743
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
elementEnd
function elementEnd() { if (isParent) { isParent = false; } else { ngDevMode && assertHasParent(); previousOrParentNode = getParentLNode(previousOrParentNode); } ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */); var queries = previousOrParentNode.queries; queries && queries.addNode(previousOrParentNode); queueLifecycleHooks(previousOrParentNode.tNode.flags, tView); currentElementNode = null; }
javascript
function elementEnd() { if (isParent) { isParent = false; } else { ngDevMode && assertHasParent(); previousOrParentNode = getParentLNode(previousOrParentNode); } ngDevMode && assertNodeType(previousOrParentNode, 3 /* Element */); var queries = previousOrParentNode.queries; queries && queries.addNode(previousOrParentNode); queueLifecycleHooks(previousOrParentNode.tNode.flags, tView); currentElementNode = null; }
[ "function", "elementEnd", "(", ")", "{", "if", "(", "isParent", ")", "{", "isParent", "=", "false", ";", "}", "else", "{", "ngDevMode", "&&", "assertHasParent", "(", ")", ";", "previousOrParentNode", "=", "getParentLNode", "(", "previousOrParentNode", ")", ";", "}", "ngDevMode", "&&", "assertNodeType", "(", "previousOrParentNode", ",", "3", "/* Element */", ")", ";", "var", "queries", "=", "previousOrParentNode", ".", "queries", ";", "queries", "&&", "queries", ".", "addNode", "(", "previousOrParentNode", ")", ";", "queueLifecycleHooks", "(", "previousOrParentNode", ".", "tNode", ".", "flags", ",", "tView", ")", ";", "currentElementNode", "=", "null", ";", "}" ]
Mark the end of the element.
[ "Mark", "the", "end", "of", "the", "element", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22424-L22437
11,744
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
elementAttribute
function elementAttribute(index, name, value, sanitizer) { if (value !== NO_CHANGE) { var element_1 = loadElement(index); if (value == null) { ngDevMode && ngDevMode.rendererRemoveAttribute++; isProceduralRenderer(renderer) ? renderer.removeAttribute(element_1.native, name) : element_1.native.removeAttribute(name); } else { ngDevMode && ngDevMode.rendererSetAttribute++; var strValue = sanitizer == null ? stringify$1(value) : sanitizer(value); isProceduralRenderer(renderer) ? renderer.setAttribute(element_1.native, name, strValue) : element_1.native.setAttribute(name, strValue); } } }
javascript
function elementAttribute(index, name, value, sanitizer) { if (value !== NO_CHANGE) { var element_1 = loadElement(index); if (value == null) { ngDevMode && ngDevMode.rendererRemoveAttribute++; isProceduralRenderer(renderer) ? renderer.removeAttribute(element_1.native, name) : element_1.native.removeAttribute(name); } else { ngDevMode && ngDevMode.rendererSetAttribute++; var strValue = sanitizer == null ? stringify$1(value) : sanitizer(value); isProceduralRenderer(renderer) ? renderer.setAttribute(element_1.native, name, strValue) : element_1.native.setAttribute(name, strValue); } } }
[ "function", "elementAttribute", "(", "index", ",", "name", ",", "value", ",", "sanitizer", ")", "{", "if", "(", "value", "!==", "NO_CHANGE", ")", "{", "var", "element_1", "=", "loadElement", "(", "index", ")", ";", "if", "(", "value", "==", "null", ")", "{", "ngDevMode", "&&", "ngDevMode", ".", "rendererRemoveAttribute", "++", ";", "isProceduralRenderer", "(", "renderer", ")", "?", "renderer", ".", "removeAttribute", "(", "element_1", ".", "native", ",", "name", ")", ":", "element_1", ".", "native", ".", "removeAttribute", "(", "name", ")", ";", "}", "else", "{", "ngDevMode", "&&", "ngDevMode", ".", "rendererSetAttribute", "++", ";", "var", "strValue", "=", "sanitizer", "==", "null", "?", "stringify$1", "(", "value", ")", ":", "sanitizer", "(", "value", ")", ";", "isProceduralRenderer", "(", "renderer", ")", "?", "renderer", ".", "setAttribute", "(", "element_1", ".", "native", ",", "name", ",", "strValue", ")", ":", "element_1", ".", "native", ".", "setAttribute", "(", "name", ",", "strValue", ")", ";", "}", "}", "}" ]
Updates the value of removes an attribute on an Element. @param number index The index of the element in the data array @param name name The name of the attribute. @param value value The attribute is removed when value is `null` or `undefined`. Otherwise the attribute value is set to the stringified value. @param sanitizer An optional function used to sanitize the value.
[ "Updates", "the", "value", "of", "removes", "an", "attribute", "on", "an", "Element", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22447-L22462
11,745
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
elementProperty
function elementProperty(index, propName, value, sanitizer) { if (value === NO_CHANGE) return; var node = loadElement(index); var tNode = node.tNode; // if tNode.inputs is undefined, a listener has created outputs, but inputs haven't // yet been checked if (tNode && tNode.inputs === undefined) { // mark inputs as checked tNode.inputs = generatePropertyAliases(node.tNode.flags, 0 /* Input */); } var inputData = tNode && tNode.inputs; var dataValue; if (inputData && (dataValue = inputData[propName])) { setInputsForProperty(dataValue, value); markDirtyIfOnPush(node); } else { // It is assumed that the sanitizer is only added when the compiler determines that the property // is risky, so sanitization can be done without further checks. value = sanitizer != null ? sanitizer(value) : value; var native = node.native; ngDevMode && ngDevMode.rendererSetProperty++; isProceduralRenderer(renderer) ? renderer.setProperty(native, propName, value) : (native.setProperty ? native.setProperty(propName, value) : native[propName] = value); } }
javascript
function elementProperty(index, propName, value, sanitizer) { if (value === NO_CHANGE) return; var node = loadElement(index); var tNode = node.tNode; // if tNode.inputs is undefined, a listener has created outputs, but inputs haven't // yet been checked if (tNode && tNode.inputs === undefined) { // mark inputs as checked tNode.inputs = generatePropertyAliases(node.tNode.flags, 0 /* Input */); } var inputData = tNode && tNode.inputs; var dataValue; if (inputData && (dataValue = inputData[propName])) { setInputsForProperty(dataValue, value); markDirtyIfOnPush(node); } else { // It is assumed that the sanitizer is only added when the compiler determines that the property // is risky, so sanitization can be done without further checks. value = sanitizer != null ? sanitizer(value) : value; var native = node.native; ngDevMode && ngDevMode.rendererSetProperty++; isProceduralRenderer(renderer) ? renderer.setProperty(native, propName, value) : (native.setProperty ? native.setProperty(propName, value) : native[propName] = value); } }
[ "function", "elementProperty", "(", "index", ",", "propName", ",", "value", ",", "sanitizer", ")", "{", "if", "(", "value", "===", "NO_CHANGE", ")", "return", ";", "var", "node", "=", "loadElement", "(", "index", ")", ";", "var", "tNode", "=", "node", ".", "tNode", ";", "// if tNode.inputs is undefined, a listener has created outputs, but inputs haven't", "// yet been checked", "if", "(", "tNode", "&&", "tNode", ".", "inputs", "===", "undefined", ")", "{", "// mark inputs as checked", "tNode", ".", "inputs", "=", "generatePropertyAliases", "(", "node", ".", "tNode", ".", "flags", ",", "0", "/* Input */", ")", ";", "}", "var", "inputData", "=", "tNode", "&&", "tNode", ".", "inputs", ";", "var", "dataValue", ";", "if", "(", "inputData", "&&", "(", "dataValue", "=", "inputData", "[", "propName", "]", ")", ")", "{", "setInputsForProperty", "(", "dataValue", ",", "value", ")", ";", "markDirtyIfOnPush", "(", "node", ")", ";", "}", "else", "{", "// It is assumed that the sanitizer is only added when the compiler determines that the property", "// is risky, so sanitization can be done without further checks.", "value", "=", "sanitizer", "!=", "null", "?", "sanitizer", "(", "value", ")", ":", "value", ";", "var", "native", "=", "node", ".", "native", ";", "ngDevMode", "&&", "ngDevMode", ".", "rendererSetProperty", "++", ";", "isProceduralRenderer", "(", "renderer", ")", "?", "renderer", ".", "setProperty", "(", "native", ",", "propName", ",", "value", ")", ":", "(", "native", ".", "setProperty", "?", "native", ".", "setProperty", "(", "propName", ",", "value", ")", ":", "native", "[", "propName", "]", "=", "value", ")", ";", "}", "}" ]
Update a property on an Element. If the property name also exists as an input property on one of the element's directives, the component property will be set instead of the element property. This check must be conducted at runtime so child components that add new @Inputs don't have to be re-compiled. @param index The index of the element to update in the data array @param propName Name of property. Because it is going to DOM, this is not subject to renaming as part of minification. @param value New value to write. @param sanitizer An optional function used to sanitize the value.
[ "Update", "a", "property", "on", "an", "Element", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22476-L22503
11,746
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
createTNode
function createTNode(type, adjustedIndex, tagName, attrs, parent, tViews) { ngDevMode && ngDevMode.tNode++; return { type: type, index: adjustedIndex, flags: 0, tagName: tagName, attrs: attrs, localNames: null, initialInputs: undefined, inputs: undefined, outputs: undefined, tViews: tViews, next: null, child: null, parent: parent, dynamicContainerNode: null, detached: null, stylingTemplate: null, projection: null }; }
javascript
function createTNode(type, adjustedIndex, tagName, attrs, parent, tViews) { ngDevMode && ngDevMode.tNode++; return { type: type, index: adjustedIndex, flags: 0, tagName: tagName, attrs: attrs, localNames: null, initialInputs: undefined, inputs: undefined, outputs: undefined, tViews: tViews, next: null, child: null, parent: parent, dynamicContainerNode: null, detached: null, stylingTemplate: null, projection: null }; }
[ "function", "createTNode", "(", "type", ",", "adjustedIndex", ",", "tagName", ",", "attrs", ",", "parent", ",", "tViews", ")", "{", "ngDevMode", "&&", "ngDevMode", ".", "tNode", "++", ";", "return", "{", "type", ":", "type", ",", "index", ":", "adjustedIndex", ",", "flags", ":", "0", ",", "tagName", ":", "tagName", ",", "attrs", ":", "attrs", ",", "localNames", ":", "null", ",", "initialInputs", ":", "undefined", ",", "inputs", ":", "undefined", ",", "outputs", ":", "undefined", ",", "tViews", ":", "tViews", ",", "next", ":", "null", ",", "child", ":", "null", ",", "parent", ":", "parent", ",", "dynamicContainerNode", ":", "null", ",", "detached", ":", "null", ",", "stylingTemplate", ":", "null", ",", "projection", ":", "null", "}", ";", "}" ]
Constructs a TNode object from the arguments. @param type The type of the node @param adjustedIndex The index of the TNode in TView.data, adjusted for HEADER_OFFSET @param tagName The tag name of the node @param attrs The attributes defined on this node @param parent The parent of this node @param tViews Any TViews attached to this node @returns the TNode object
[ "Constructs", "a", "TNode", "object", "from", "the", "arguments", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22515-L22536
11,747
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
setInputsForProperty
function setInputsForProperty(inputs, value) { for (var i = 0; i < inputs.length; i += 2) { ngDevMode && assertDataInRange(inputs[i], directives); directives[inputs[i]][inputs[i + 1]] = value; } }
javascript
function setInputsForProperty(inputs, value) { for (var i = 0; i < inputs.length; i += 2) { ngDevMode && assertDataInRange(inputs[i], directives); directives[inputs[i]][inputs[i + 1]] = value; } }
[ "function", "setInputsForProperty", "(", "inputs", ",", "value", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "inputs", ".", "length", ";", "i", "+=", "2", ")", "{", "ngDevMode", "&&", "assertDataInRange", "(", "inputs", "[", "i", "]", ",", "directives", ")", ";", "directives", "[", "inputs", "[", "i", "]", "]", "[", "inputs", "[", "i", "+", "1", "]", "]", "=", "value", ";", "}", "}" ]
Given a list of directive indices and minified input names, sets the input properties on the corresponding directives.
[ "Given", "a", "list", "of", "directive", "indices", "and", "minified", "input", "names", "sets", "the", "input", "properties", "on", "the", "corresponding", "directives", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22541-L22546
11,748
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
generatePropertyAliases
function generatePropertyAliases(tNodeFlags, direction) { var count = tNodeFlags & 4095 /* DirectiveCountMask */; var propStore = null; if (count > 0) { var start = tNodeFlags >> 14 /* DirectiveStartingIndexShift */; var end = start + count; var isInput = direction === 0 /* Input */; var defs = tView.directives; for (var i = start; i < end; i++) { var directiveDef = defs[i]; var propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs; for (var publicName in propertyAliasMap) { if (propertyAliasMap.hasOwnProperty(publicName)) { propStore = propStore || {}; var internalName = propertyAliasMap[publicName]; var hasProperty = propStore.hasOwnProperty(publicName); hasProperty ? propStore[publicName].push(i, internalName) : (propStore[publicName] = [i, internalName]); } } } } return propStore; }
javascript
function generatePropertyAliases(tNodeFlags, direction) { var count = tNodeFlags & 4095 /* DirectiveCountMask */; var propStore = null; if (count > 0) { var start = tNodeFlags >> 14 /* DirectiveStartingIndexShift */; var end = start + count; var isInput = direction === 0 /* Input */; var defs = tView.directives; for (var i = start; i < end; i++) { var directiveDef = defs[i]; var propertyAliasMap = isInput ? directiveDef.inputs : directiveDef.outputs; for (var publicName in propertyAliasMap) { if (propertyAliasMap.hasOwnProperty(publicName)) { propStore = propStore || {}; var internalName = propertyAliasMap[publicName]; var hasProperty = propStore.hasOwnProperty(publicName); hasProperty ? propStore[publicName].push(i, internalName) : (propStore[publicName] = [i, internalName]); } } } } return propStore; }
[ "function", "generatePropertyAliases", "(", "tNodeFlags", ",", "direction", ")", "{", "var", "count", "=", "tNodeFlags", "&", "4095", "/* DirectiveCountMask */", ";", "var", "propStore", "=", "null", ";", "if", "(", "count", ">", "0", ")", "{", "var", "start", "=", "tNodeFlags", ">>", "14", "/* DirectiveStartingIndexShift */", ";", "var", "end", "=", "start", "+", "count", ";", "var", "isInput", "=", "direction", "===", "0", "/* Input */", ";", "var", "defs", "=", "tView", ".", "directives", ";", "for", "(", "var", "i", "=", "start", ";", "i", "<", "end", ";", "i", "++", ")", "{", "var", "directiveDef", "=", "defs", "[", "i", "]", ";", "var", "propertyAliasMap", "=", "isInput", "?", "directiveDef", ".", "inputs", ":", "directiveDef", ".", "outputs", ";", "for", "(", "var", "publicName", "in", "propertyAliasMap", ")", "{", "if", "(", "propertyAliasMap", ".", "hasOwnProperty", "(", "publicName", ")", ")", "{", "propStore", "=", "propStore", "||", "{", "}", ";", "var", "internalName", "=", "propertyAliasMap", "[", "publicName", "]", ";", "var", "hasProperty", "=", "propStore", ".", "hasOwnProperty", "(", "publicName", ")", ";", "hasProperty", "?", "propStore", "[", "publicName", "]", ".", "push", "(", "i", ",", "internalName", ")", ":", "(", "propStore", "[", "publicName", "]", "=", "[", "i", ",", "internalName", "]", ")", ";", "}", "}", "}", "}", "return", "propStore", ";", "}" ]
Consolidates all inputs or outputs of all directives on this logical node. @param number lNodeFlags logical node flags @param Direction direction whether to consider inputs or outputs @returns PropertyAliases|null aggregate of all properties if any, `null` otherwise
[ "Consolidates", "all", "inputs", "or", "outputs", "of", "all", "directives", "on", "this", "logical", "node", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22554-L22577
11,749
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
elementClassProp
function elementClassProp(index, stylingIndex, value) { updateClassProp(getStylingContext(index), stylingIndex, value ? true : false); }
javascript
function elementClassProp(index, stylingIndex, value) { updateClassProp(getStylingContext(index), stylingIndex, value ? true : false); }
[ "function", "elementClassProp", "(", "index", ",", "stylingIndex", ",", "value", ")", "{", "updateClassProp", "(", "getStylingContext", "(", "index", ")", ",", "stylingIndex", ",", "value", "?", "true", ":", "false", ")", ";", "}" ]
Add or remove a class in a `classList` on a DOM element. This instruction is meant to handle the [class.foo]="exp" case @param index The index of the element to update in the data array @param className Name of class to toggle. Because it is going to DOM, this is not subject to renaming as part of minification. @param value A value indicating if a given class should be added or removed.
[ "Add", "or", "remove", "a", "class", "in", "a", "classList", "on", "a", "DOM", "element", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22588-L22590
11,750
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
elementStyling
function elementStyling(classDeclarations, styleDeclarations, styleSanitizer) { var lElement = currentElementNode; var tNode = lElement.tNode; if (!tNode.stylingTemplate) { // initialize the styling template. tNode.stylingTemplate = createStylingContextTemplate(classDeclarations, styleDeclarations, styleSanitizer); } if (styleDeclarations && styleDeclarations.length || classDeclarations && classDeclarations.length) { elementStylingApply(tNode.index - HEADER_OFFSET); } }
javascript
function elementStyling(classDeclarations, styleDeclarations, styleSanitizer) { var lElement = currentElementNode; var tNode = lElement.tNode; if (!tNode.stylingTemplate) { // initialize the styling template. tNode.stylingTemplate = createStylingContextTemplate(classDeclarations, styleDeclarations, styleSanitizer); } if (styleDeclarations && styleDeclarations.length || classDeclarations && classDeclarations.length) { elementStylingApply(tNode.index - HEADER_OFFSET); } }
[ "function", "elementStyling", "(", "classDeclarations", ",", "styleDeclarations", ",", "styleSanitizer", ")", "{", "var", "lElement", "=", "currentElementNode", ";", "var", "tNode", "=", "lElement", ".", "tNode", ";", "if", "(", "!", "tNode", ".", "stylingTemplate", ")", "{", "// initialize the styling template.", "tNode", ".", "stylingTemplate", "=", "createStylingContextTemplate", "(", "classDeclarations", ",", "styleDeclarations", ",", "styleSanitizer", ")", ";", "}", "if", "(", "styleDeclarations", "&&", "styleDeclarations", ".", "length", "||", "classDeclarations", "&&", "classDeclarations", ".", "length", ")", "{", "elementStylingApply", "(", "tNode", ".", "index", "-", "HEADER_OFFSET", ")", ";", "}", "}" ]
Assign any inline style values to the element during creation mode. This instruction is meant to be called during creation mode to apply all styling (e.g. `style="..."`) values to the element. This is also where the provided index value is allocated for the styling details for its corresponding element (the element index is the previous index value from this one). (Note this function calls `elementStylingApply` immediately when called.) @param index Index value which will be allocated to store styling data for the element. (Note that this is not the element index, but rather an index value allocated specifically for element styling--the index must be the next index after the element index.) @param classDeclarations A key/value array of CSS classes that will be registered on the element. Each individual style will be used on the element as long as it is not overridden by any classes placed on the element by multiple (`[class]`) or singular (`[class.named]`) bindings. If a class binding changes its value to a falsy value then the matching initial class value that are passed in here will be applied to the element (if matched). @param styleDeclarations A key/value array of CSS styles that will be registered on the element. Each individual style will be used on the element as long as it is not overridden by any styles placed on the element by multiple (`[style]`) or singular (`[style.prop]`) bindings. If a style binding changes its value to null then the initial styling values that are passed in here will be applied to the element (if matched). @param styleSanitizer An optional sanitizer function that will be used (if provided) to sanitize the any CSS property values that are applied to the element (during rendering).
[ "Assign", "any", "inline", "style", "values", "to", "the", "element", "during", "creation", "mode", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22619-L22631
11,751
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getStylingContext
function getStylingContext(index) { var stylingContext = load(index); if (!Array.isArray(stylingContext)) { var lElement = stylingContext; var tNode = lElement.tNode; ngDevMode && assertDefined(tNode.stylingTemplate, 'getStylingContext() called before elementStyling()'); stylingContext = viewData[index + HEADER_OFFSET] = allocStylingContext(lElement, tNode.stylingTemplate); } return stylingContext; }
javascript
function getStylingContext(index) { var stylingContext = load(index); if (!Array.isArray(stylingContext)) { var lElement = stylingContext; var tNode = lElement.tNode; ngDevMode && assertDefined(tNode.stylingTemplate, 'getStylingContext() called before elementStyling()'); stylingContext = viewData[index + HEADER_OFFSET] = allocStylingContext(lElement, tNode.stylingTemplate); } return stylingContext; }
[ "function", "getStylingContext", "(", "index", ")", "{", "var", "stylingContext", "=", "load", "(", "index", ")", ";", "if", "(", "!", "Array", ".", "isArray", "(", "stylingContext", ")", ")", "{", "var", "lElement", "=", "stylingContext", ";", "var", "tNode", "=", "lElement", ".", "tNode", ";", "ngDevMode", "&&", "assertDefined", "(", "tNode", ".", "stylingTemplate", ",", "'getStylingContext() called before elementStyling()'", ")", ";", "stylingContext", "=", "viewData", "[", "index", "+", "HEADER_OFFSET", "]", "=", "allocStylingContext", "(", "lElement", ",", "tNode", ".", "stylingTemplate", ")", ";", "}", "return", "stylingContext", ";", "}" ]
Retrieve the `StylingContext` at a given index. This method lazily creates the `StylingContext`. This is because in most cases we have styling without any bindings. Creating `StylingContext` eagerly would mean that every style declaration such as `<div style="color: red">` would result `StyleContext` which would create unnecessary memory pressure. @param index Index of the style allocation. See: `elementStyling`.
[ "Retrieve", "the", "StylingContext", "at", "a", "given", "index", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22642-L22653
11,752
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
elementStyleProp
function elementStyleProp(index, styleIndex, value, suffix) { var valueToAdd = null; if (value) { if (suffix) { // when a suffix is applied then it will bypass // sanitization entirely (b/c a new string is created) valueToAdd = stringify$1(value) + suffix; } else { // sanitization happens by dealing with a String value // this means that the string value will be passed through // into the style rendering later (which is where the value // will be sanitized before it is applied) valueToAdd = value; } } updateStyleProp(getStylingContext(index), styleIndex, valueToAdd); }
javascript
function elementStyleProp(index, styleIndex, value, suffix) { var valueToAdd = null; if (value) { if (suffix) { // when a suffix is applied then it will bypass // sanitization entirely (b/c a new string is created) valueToAdd = stringify$1(value) + suffix; } else { // sanitization happens by dealing with a String value // this means that the string value will be passed through // into the style rendering later (which is where the value // will be sanitized before it is applied) valueToAdd = value; } } updateStyleProp(getStylingContext(index), styleIndex, valueToAdd); }
[ "function", "elementStyleProp", "(", "index", ",", "styleIndex", ",", "value", ",", "suffix", ")", "{", "var", "valueToAdd", "=", "null", ";", "if", "(", "value", ")", "{", "if", "(", "suffix", ")", "{", "// when a suffix is applied then it will bypass", "// sanitization entirely (b/c a new string is created)", "valueToAdd", "=", "stringify$1", "(", "value", ")", "+", "suffix", ";", "}", "else", "{", "// sanitization happens by dealing with a String value", "// this means that the string value will be passed through", "// into the style rendering later (which is where the value", "// will be sanitized before it is applied)", "valueToAdd", "=", "value", ";", "}", "}", "updateStyleProp", "(", "getStylingContext", "(", "index", ")", ",", "styleIndex", ",", "valueToAdd", ")", ";", "}" ]
Queue a given style to be rendered on an Element. If the style value is `null` then it will be removed from the element (or assigned a different value depending if there are any styles placed on the element with `elementStyle` or any styles that are present from when the element was created (with `elementStyling`). (Note that the styling instruction will not be applied until `elementStylingApply` is called.) @param index Index of the element's styling storage to change in the data array. (Note that this is not the element index, but rather an index value allocated specifically for element styling--the index must be the next index after the element index.) @param styleIndex Index of the style property on this element. (Monotonically increasing.) @param styleName Name of property. Because it is going to DOM this is not subject to renaming as part of minification. @param value New value to write (null to remove). @param suffix Optional suffix. Used with scalar values to add unit such as `px`. Note that when a suffix is provided then the underlying sanitizer will be ignored.
[ "Queue", "a", "given", "style", "to", "be", "rendered", "on", "an", "Element", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22693-L22710
11,753
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
setInputsFromAttrs
function setInputsFromAttrs(directiveIndex, instance, inputs, tNode) { var initialInputData = tNode.initialInputs; if (initialInputData === undefined || directiveIndex >= initialInputData.length) { initialInputData = generateInitialInputs(directiveIndex, inputs, tNode); } var initialInputs = initialInputData[directiveIndex]; if (initialInputs) { for (var i = 0; i < initialInputs.length; i += 2) { instance[initialInputs[i]] = initialInputs[i + 1]; } } }
javascript
function setInputsFromAttrs(directiveIndex, instance, inputs, tNode) { var initialInputData = tNode.initialInputs; if (initialInputData === undefined || directiveIndex >= initialInputData.length) { initialInputData = generateInitialInputs(directiveIndex, inputs, tNode); } var initialInputs = initialInputData[directiveIndex]; if (initialInputs) { for (var i = 0; i < initialInputs.length; i += 2) { instance[initialInputs[i]] = initialInputs[i + 1]; } } }
[ "function", "setInputsFromAttrs", "(", "directiveIndex", ",", "instance", ",", "inputs", ",", "tNode", ")", "{", "var", "initialInputData", "=", "tNode", ".", "initialInputs", ";", "if", "(", "initialInputData", "===", "undefined", "||", "directiveIndex", ">=", "initialInputData", ".", "length", ")", "{", "initialInputData", "=", "generateInitialInputs", "(", "directiveIndex", ",", "inputs", ",", "tNode", ")", ";", "}", "var", "initialInputs", "=", "initialInputData", "[", "directiveIndex", "]", ";", "if", "(", "initialInputs", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "initialInputs", ".", "length", ";", "i", "+=", "2", ")", "{", "instance", "[", "initialInputs", "[", "i", "]", "]", "=", "initialInputs", "[", "i", "+", "1", "]", ";", "}", "}", "}" ]
Sets initial input properties on directive instances from attribute data @param directiveIndex Index of the directive in directives array @param instance Instance of the directive on which to set the initial inputs @param inputs The list of inputs from the directive def @param tNode The static data for this node
[ "Sets", "initial", "input", "properties", "on", "directive", "instances", "from", "attribute", "data" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22868-L22879
11,754
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
generateInitialInputs
function generateInitialInputs(directiveIndex, inputs, tNode) { var initialInputData = tNode.initialInputs || (tNode.initialInputs = []); initialInputData[directiveIndex] = null; var attrs = tNode.attrs; var i = 0; while (i < attrs.length) { var attrName = attrs[i]; if (attrName === 1 /* SelectOnly */) break; if (attrName === 0 /* NamespaceURI */) { // We do not allow inputs on namespaced attributes. i += 4; continue; } var minifiedInputName = inputs[attrName]; var attrValue = attrs[i + 1]; if (minifiedInputName !== undefined) { var inputsToStore = initialInputData[directiveIndex] || (initialInputData[directiveIndex] = []); inputsToStore.push(minifiedInputName, attrValue); } i += 2; } return initialInputData; }
javascript
function generateInitialInputs(directiveIndex, inputs, tNode) { var initialInputData = tNode.initialInputs || (tNode.initialInputs = []); initialInputData[directiveIndex] = null; var attrs = tNode.attrs; var i = 0; while (i < attrs.length) { var attrName = attrs[i]; if (attrName === 1 /* SelectOnly */) break; if (attrName === 0 /* NamespaceURI */) { // We do not allow inputs on namespaced attributes. i += 4; continue; } var minifiedInputName = inputs[attrName]; var attrValue = attrs[i + 1]; if (minifiedInputName !== undefined) { var inputsToStore = initialInputData[directiveIndex] || (initialInputData[directiveIndex] = []); inputsToStore.push(minifiedInputName, attrValue); } i += 2; } return initialInputData; }
[ "function", "generateInitialInputs", "(", "directiveIndex", ",", "inputs", ",", "tNode", ")", "{", "var", "initialInputData", "=", "tNode", ".", "initialInputs", "||", "(", "tNode", ".", "initialInputs", "=", "[", "]", ")", ";", "initialInputData", "[", "directiveIndex", "]", "=", "null", ";", "var", "attrs", "=", "tNode", ".", "attrs", ";", "var", "i", "=", "0", ";", "while", "(", "i", "<", "attrs", ".", "length", ")", "{", "var", "attrName", "=", "attrs", "[", "i", "]", ";", "if", "(", "attrName", "===", "1", "/* SelectOnly */", ")", "break", ";", "if", "(", "attrName", "===", "0", "/* NamespaceURI */", ")", "{", "// We do not allow inputs on namespaced attributes.", "i", "+=", "4", ";", "continue", ";", "}", "var", "minifiedInputName", "=", "inputs", "[", "attrName", "]", ";", "var", "attrValue", "=", "attrs", "[", "i", "+", "1", "]", ";", "if", "(", "minifiedInputName", "!==", "undefined", ")", "{", "var", "inputsToStore", "=", "initialInputData", "[", "directiveIndex", "]", "||", "(", "initialInputData", "[", "directiveIndex", "]", "=", "[", "]", ")", ";", "inputsToStore", ".", "push", "(", "minifiedInputName", ",", "attrValue", ")", ";", "}", "i", "+=", "2", ";", "}", "return", "initialInputData", ";", "}" ]
Generates initialInputData for a node and stores it in the template's static storage so subsequent template invocations don't have to recalculate it. initialInputData is an array containing values that need to be set as input properties for directives on this node, but only once on creation. We need this array to support the case where you set an @Input property of a directive using attribute-like syntax. e.g. if you have a `name` @Input, you can set it once like this: <my-component name="Bess"></my-component> @param directiveIndex Index to store the initial input data @param inputs The list of inputs from the directive def @param tNode The static data on this node
[ "Generates", "initialInputData", "for", "a", "node", "and", "stores", "it", "in", "the", "template", "s", "static", "storage", "so", "subsequent", "template", "invocations", "don", "t", "have", "to", "recalculate", "it", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22895-L22918
11,755
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
container
function container(index, template, tagName, attrs, localRefs) { ngDevMode && assertEqual(viewData[BINDING_INDEX], -1, 'container nodes should be created before any bindings'); var currentParent = isParent ? previousOrParentNode : getParentLNode(previousOrParentNode); var lContainer = createLContainer(currentParent, viewData); var comment = renderer.createComment(ngDevMode ? 'container' : ''); var node = createLNode(index, 0 /* Container */, comment, tagName || null, attrs || null, lContainer); appendChild(getParentLNode(node), comment, viewData); if (firstTemplatePass) { node.tNode.tViews = template ? createTView(-1, template, tView.directiveRegistry, tView.pipeRegistry, null) : []; } // Containers are added to the current view tree instead of their embedded views // because views can be removed and re-inserted. addToViewTree(viewData, index + HEADER_OFFSET, node.data); var queries = node.queries; if (queries) { // prepare place for matching nodes from views inserted into a given container lContainer[QUERIES] = queries.container(); } createDirectivesAndLocals(localRefs); isParent = false; ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */); queries && queries.addNode(node); // check if a given container node matches queueLifecycleHooks(node.tNode.flags, tView); }
javascript
function container(index, template, tagName, attrs, localRefs) { ngDevMode && assertEqual(viewData[BINDING_INDEX], -1, 'container nodes should be created before any bindings'); var currentParent = isParent ? previousOrParentNode : getParentLNode(previousOrParentNode); var lContainer = createLContainer(currentParent, viewData); var comment = renderer.createComment(ngDevMode ? 'container' : ''); var node = createLNode(index, 0 /* Container */, comment, tagName || null, attrs || null, lContainer); appendChild(getParentLNode(node), comment, viewData); if (firstTemplatePass) { node.tNode.tViews = template ? createTView(-1, template, tView.directiveRegistry, tView.pipeRegistry, null) : []; } // Containers are added to the current view tree instead of their embedded views // because views can be removed and re-inserted. addToViewTree(viewData, index + HEADER_OFFSET, node.data); var queries = node.queries; if (queries) { // prepare place for matching nodes from views inserted into a given container lContainer[QUERIES] = queries.container(); } createDirectivesAndLocals(localRefs); isParent = false; ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */); queries && queries.addNode(node); // check if a given container node matches queueLifecycleHooks(node.tNode.flags, tView); }
[ "function", "container", "(", "index", ",", "template", ",", "tagName", ",", "attrs", ",", "localRefs", ")", "{", "ngDevMode", "&&", "assertEqual", "(", "viewData", "[", "BINDING_INDEX", "]", ",", "-", "1", ",", "'container nodes should be created before any bindings'", ")", ";", "var", "currentParent", "=", "isParent", "?", "previousOrParentNode", ":", "getParentLNode", "(", "previousOrParentNode", ")", ";", "var", "lContainer", "=", "createLContainer", "(", "currentParent", ",", "viewData", ")", ";", "var", "comment", "=", "renderer", ".", "createComment", "(", "ngDevMode", "?", "'container'", ":", "''", ")", ";", "var", "node", "=", "createLNode", "(", "index", ",", "0", "/* Container */", ",", "comment", ",", "tagName", "||", "null", ",", "attrs", "||", "null", ",", "lContainer", ")", ";", "appendChild", "(", "getParentLNode", "(", "node", ")", ",", "comment", ",", "viewData", ")", ";", "if", "(", "firstTemplatePass", ")", "{", "node", ".", "tNode", ".", "tViews", "=", "template", "?", "createTView", "(", "-", "1", ",", "template", ",", "tView", ".", "directiveRegistry", ",", "tView", ".", "pipeRegistry", ",", "null", ")", ":", "[", "]", ";", "}", "// Containers are added to the current view tree instead of their embedded views", "// because views can be removed and re-inserted.", "addToViewTree", "(", "viewData", ",", "index", "+", "HEADER_OFFSET", ",", "node", ".", "data", ")", ";", "var", "queries", "=", "node", ".", "queries", ";", "if", "(", "queries", ")", "{", "// prepare place for matching nodes from views inserted into a given container", "lContainer", "[", "QUERIES", "]", "=", "queries", ".", "container", "(", ")", ";", "}", "createDirectivesAndLocals", "(", "localRefs", ")", ";", "isParent", "=", "false", ";", "ngDevMode", "&&", "assertNodeType", "(", "previousOrParentNode", ",", "0", "/* Container */", ")", ";", "queries", "&&", "queries", ".", "addNode", "(", "node", ")", ";", "// check if a given container node matches", "queueLifecycleHooks", "(", "node", ".", "tNode", ".", "flags", ",", "tView", ")", ";", "}" ]
Creates an LContainerNode. Only `LViewNodes` can go into `LContainerNodes`. @param index The index of the container in the data array @param template Optional inline template @param tagName The name of the container element, if applicable @param attrs The attrs attached to the container, if applicable @param localRefs A set of local reference bindings on the element.
[ "Creates", "an", "LContainerNode", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22958-L22984
11,756
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
containerRefreshStart
function containerRefreshStart(index) { previousOrParentNode = loadElement(index); ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */); isParent = true; previousOrParentNode.data[ACTIVE_INDEX] = 0; if (!checkNoChangesMode) { // We need to execute init hooks here so ngOnInit hooks are called in top level views // before they are called in embedded views (for backwards compatibility). executeInitHooks(viewData, tView, creationMode); } }
javascript
function containerRefreshStart(index) { previousOrParentNode = loadElement(index); ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */); isParent = true; previousOrParentNode.data[ACTIVE_INDEX] = 0; if (!checkNoChangesMode) { // We need to execute init hooks here so ngOnInit hooks are called in top level views // before they are called in embedded views (for backwards compatibility). executeInitHooks(viewData, tView, creationMode); } }
[ "function", "containerRefreshStart", "(", "index", ")", "{", "previousOrParentNode", "=", "loadElement", "(", "index", ")", ";", "ngDevMode", "&&", "assertNodeType", "(", "previousOrParentNode", ",", "0", "/* Container */", ")", ";", "isParent", "=", "true", ";", "previousOrParentNode", ".", "data", "[", "ACTIVE_INDEX", "]", "=", "0", ";", "if", "(", "!", "checkNoChangesMode", ")", "{", "// We need to execute init hooks here so ngOnInit hooks are called in top level views", "// before they are called in embedded views (for backwards compatibility).", "executeInitHooks", "(", "viewData", ",", "tView", ",", "creationMode", ")", ";", "}", "}" ]
Sets a container up to receive views. @param index The index of the container in the data array
[ "Sets", "a", "container", "up", "to", "receive", "views", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L22990-L23000
11,757
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
containerRefreshEnd
function containerRefreshEnd() { if (isParent) { isParent = false; } else { ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */); ngDevMode && assertHasParent(); previousOrParentNode = getParentLNode(previousOrParentNode); } ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */); var container = previousOrParentNode; ngDevMode && assertNodeType(container, 0 /* Container */); var nextIndex = container.data[ACTIVE_INDEX]; // remove extra views at the end of the container while (nextIndex < container.data[VIEWS].length) { removeView(container, nextIndex); } }
javascript
function containerRefreshEnd() { if (isParent) { isParent = false; } else { ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */); ngDevMode && assertHasParent(); previousOrParentNode = getParentLNode(previousOrParentNode); } ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */); var container = previousOrParentNode; ngDevMode && assertNodeType(container, 0 /* Container */); var nextIndex = container.data[ACTIVE_INDEX]; // remove extra views at the end of the container while (nextIndex < container.data[VIEWS].length) { removeView(container, nextIndex); } }
[ "function", "containerRefreshEnd", "(", ")", "{", "if", "(", "isParent", ")", "{", "isParent", "=", "false", ";", "}", "else", "{", "ngDevMode", "&&", "assertNodeType", "(", "previousOrParentNode", ",", "2", "/* View */", ")", ";", "ngDevMode", "&&", "assertHasParent", "(", ")", ";", "previousOrParentNode", "=", "getParentLNode", "(", "previousOrParentNode", ")", ";", "}", "ngDevMode", "&&", "assertNodeType", "(", "previousOrParentNode", ",", "0", "/* Container */", ")", ";", "var", "container", "=", "previousOrParentNode", ";", "ngDevMode", "&&", "assertNodeType", "(", "container", ",", "0", "/* Container */", ")", ";", "var", "nextIndex", "=", "container", ".", "data", "[", "ACTIVE_INDEX", "]", ";", "// remove extra views at the end of the container", "while", "(", "nextIndex", "<", "container", ".", "data", "[", "VIEWS", "]", ".", "length", ")", "{", "removeView", "(", "container", ",", "nextIndex", ")", ";", "}", "}" ]
Marks the end of the LContainerNode. Marking the end of LContainerNode is the time when to child Views get inserted or removed.
[ "Marks", "the", "end", "of", "the", "LContainerNode", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23006-L23023
11,758
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
scanForView
function scanForView(containerNode, startIdx, viewBlockId) { var views = containerNode.data[VIEWS]; for (var i = startIdx; i < views.length; i++) { var viewAtPositionId = views[i].data[TVIEW].id; if (viewAtPositionId === viewBlockId) { return views[i]; } else if (viewAtPositionId < viewBlockId) { // found a view that should not be at this position - remove removeView(containerNode, i); } else { // found a view with id greater than the one we are searching for // which means that required view doesn't exist and can't be found at // later positions in the views array - stop the search here break; } } return null; }
javascript
function scanForView(containerNode, startIdx, viewBlockId) { var views = containerNode.data[VIEWS]; for (var i = startIdx; i < views.length; i++) { var viewAtPositionId = views[i].data[TVIEW].id; if (viewAtPositionId === viewBlockId) { return views[i]; } else if (viewAtPositionId < viewBlockId) { // found a view that should not be at this position - remove removeView(containerNode, i); } else { // found a view with id greater than the one we are searching for // which means that required view doesn't exist and can't be found at // later positions in the views array - stop the search here break; } } return null; }
[ "function", "scanForView", "(", "containerNode", ",", "startIdx", ",", "viewBlockId", ")", "{", "var", "views", "=", "containerNode", ".", "data", "[", "VIEWS", "]", ";", "for", "(", "var", "i", "=", "startIdx", ";", "i", "<", "views", ".", "length", ";", "i", "++", ")", "{", "var", "viewAtPositionId", "=", "views", "[", "i", "]", ".", "data", "[", "TVIEW", "]", ".", "id", ";", "if", "(", "viewAtPositionId", "===", "viewBlockId", ")", "{", "return", "views", "[", "i", "]", ";", "}", "else", "if", "(", "viewAtPositionId", "<", "viewBlockId", ")", "{", "// found a view that should not be at this position - remove", "removeView", "(", "containerNode", ",", "i", ")", ";", "}", "else", "{", "// found a view with id greater than the one we are searching for", "// which means that required view doesn't exist and can't be found at", "// later positions in the views array - stop the search here", "break", ";", "}", "}", "return", "null", ";", "}" ]
Looks for a view with a given view block id inside a provided LContainer. Removes views that need to be deleted in the process. @param containerNode where to search for views @param startIdx starting index in the views array to search from @param viewBlockId exact view block id to look for @returns index of a found view or -1 if not found
[ "Looks", "for", "a", "view", "with", "a", "given", "view", "block", "id", "inside", "a", "provided", "LContainer", ".", "Removes", "views", "that", "need", "to", "be", "deleted", "in", "the", "process", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23054-L23073
11,759
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
embeddedViewStart
function embeddedViewStart(viewBlockId) { var container = (isParent ? previousOrParentNode : getParentLNode(previousOrParentNode)); ngDevMode && assertNodeType(container, 0 /* Container */); var lContainer = container.data; var viewNode = scanForView(container, lContainer[ACTIVE_INDEX], viewBlockId); if (viewNode) { previousOrParentNode = viewNode; ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */); isParent = true; enterView(viewNode.data, viewNode); } else { // When we create a new LView, we always reset the state of the instructions. var newView = createLViewData(renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, 2 /* CheckAlways */, getCurrentSanitizer()); if (lContainer[QUERIES]) { newView[QUERIES] = lContainer[QUERIES].createView(); } enterView(newView, viewNode = createLNode(viewBlockId, 2 /* View */, null, null, null, newView)); } if (container) { if (creationMode) { // it is a new view, insert it into collection of views for a given container insertView(container, viewNode, lContainer[ACTIVE_INDEX]); } lContainer[ACTIVE_INDEX]++; } return getRenderFlags(viewNode.data); }
javascript
function embeddedViewStart(viewBlockId) { var container = (isParent ? previousOrParentNode : getParentLNode(previousOrParentNode)); ngDevMode && assertNodeType(container, 0 /* Container */); var lContainer = container.data; var viewNode = scanForView(container, lContainer[ACTIVE_INDEX], viewBlockId); if (viewNode) { previousOrParentNode = viewNode; ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */); isParent = true; enterView(viewNode.data, viewNode); } else { // When we create a new LView, we always reset the state of the instructions. var newView = createLViewData(renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, 2 /* CheckAlways */, getCurrentSanitizer()); if (lContainer[QUERIES]) { newView[QUERIES] = lContainer[QUERIES].createView(); } enterView(newView, viewNode = createLNode(viewBlockId, 2 /* View */, null, null, null, newView)); } if (container) { if (creationMode) { // it is a new view, insert it into collection of views for a given container insertView(container, viewNode, lContainer[ACTIVE_INDEX]); } lContainer[ACTIVE_INDEX]++; } return getRenderFlags(viewNode.data); }
[ "function", "embeddedViewStart", "(", "viewBlockId", ")", "{", "var", "container", "=", "(", "isParent", "?", "previousOrParentNode", ":", "getParentLNode", "(", "previousOrParentNode", ")", ")", ";", "ngDevMode", "&&", "assertNodeType", "(", "container", ",", "0", "/* Container */", ")", ";", "var", "lContainer", "=", "container", ".", "data", ";", "var", "viewNode", "=", "scanForView", "(", "container", ",", "lContainer", "[", "ACTIVE_INDEX", "]", ",", "viewBlockId", ")", ";", "if", "(", "viewNode", ")", "{", "previousOrParentNode", "=", "viewNode", ";", "ngDevMode", "&&", "assertNodeType", "(", "previousOrParentNode", ",", "2", "/* View */", ")", ";", "isParent", "=", "true", ";", "enterView", "(", "viewNode", ".", "data", ",", "viewNode", ")", ";", "}", "else", "{", "// When we create a new LView, we always reset the state of the instructions.", "var", "newView", "=", "createLViewData", "(", "renderer", ",", "getOrCreateEmbeddedTView", "(", "viewBlockId", ",", "container", ")", ",", "null", ",", "2", "/* CheckAlways */", ",", "getCurrentSanitizer", "(", ")", ")", ";", "if", "(", "lContainer", "[", "QUERIES", "]", ")", "{", "newView", "[", "QUERIES", "]", "=", "lContainer", "[", "QUERIES", "]", ".", "createView", "(", ")", ";", "}", "enterView", "(", "newView", ",", "viewNode", "=", "createLNode", "(", "viewBlockId", ",", "2", "/* View */", ",", "null", ",", "null", ",", "null", ",", "newView", ")", ")", ";", "}", "if", "(", "container", ")", "{", "if", "(", "creationMode", ")", "{", "// it is a new view, insert it into collection of views for a given container", "insertView", "(", "container", ",", "viewNode", ",", "lContainer", "[", "ACTIVE_INDEX", "]", ")", ";", "}", "lContainer", "[", "ACTIVE_INDEX", "]", "++", ";", "}", "return", "getRenderFlags", "(", "viewNode", ".", "data", ")", ";", "}" ]
Marks the start of an embedded view. @param viewBlockId The ID of this view @return boolean Whether or not this view is in creation mode
[ "Marks", "the", "start", "of", "an", "embedded", "view", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23080-L23107
11,760
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
embeddedViewEnd
function embeddedViewEnd() { refreshView(); isParent = false; previousOrParentNode = viewData[HOST_NODE]; leaveView(viewData[PARENT]); ngDevMode && assertEqual(isParent, false, 'isParent'); ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */); }
javascript
function embeddedViewEnd() { refreshView(); isParent = false; previousOrParentNode = viewData[HOST_NODE]; leaveView(viewData[PARENT]); ngDevMode && assertEqual(isParent, false, 'isParent'); ngDevMode && assertNodeType(previousOrParentNode, 2 /* View */); }
[ "function", "embeddedViewEnd", "(", ")", "{", "refreshView", "(", ")", ";", "isParent", "=", "false", ";", "previousOrParentNode", "=", "viewData", "[", "HOST_NODE", "]", ";", "leaveView", "(", "viewData", "[", "PARENT", "]", ")", ";", "ngDevMode", "&&", "assertEqual", "(", "isParent", ",", "false", ",", "'isParent'", ")", ";", "ngDevMode", "&&", "assertNodeType", "(", "previousOrParentNode", ",", "2", "/* View */", ")", ";", "}" ]
Marks the end of an embedded view.
[ "Marks", "the", "end", "of", "an", "embedded", "view", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23131-L23138
11,761
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
projection
function projection(nodeIndex, selectorIndex, attrs) { if (selectorIndex === void 0) { selectorIndex = 0; } var node = createLNode(nodeIndex, 1 /* Projection */, null, null, attrs || null, null); // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views. if (node.tNode.projection === null) node.tNode.projection = selectorIndex; // `<ng-content>` has no content isParent = false; // re-distribution of projectable nodes is stored on a component's view level var parent = getParentLNode(node); if (canInsertNativeNode(parent, viewData)) { var componentNode = findComponentHost(viewData); var nodeToProject = componentNode.tNode.projection[selectorIndex]; var projectedView = componentNode.view; var projectionNodeIndex = -1; var grandparent = void 0; var renderParent = parent.tNode.type === 2 /* View */ ? (grandparent = getParentLNode(parent)) && grandparent.data[RENDER_PARENT] : parent; while (nodeToProject) { if (nodeToProject.type === 1 /* Projection */) { // This node is re-projected, so we must go up the tree to get its projected nodes. var currentComponentHost = findComponentHost(projectedView); var firstProjectedNode = currentComponentHost.tNode.projection[nodeToProject.projection]; if (firstProjectedNode) { projectionNodeStack$1[++projectionNodeIndex] = projectedView[nodeToProject.index]; nodeToProject = firstProjectedNode; projectedView = currentComponentHost.view; continue; } } else { var lNode = projectedView[nodeToProject.index]; lNode.tNode.flags |= 8192 /* isProjected */; appendProjectedNode(lNode, parent, viewData, renderParent); } // If we are finished with a list of re-projected nodes, we need to get // back to the root projection node that was re-projected. if (nodeToProject.next === null && projectedView !== componentNode.view) { // move down into the view of the component we're projecting right now var lNode = projectionNodeStack$1[projectionNodeIndex--]; nodeToProject = lNode.tNode; projectedView = lNode.view; } nodeToProject = nodeToProject.next; } } }
javascript
function projection(nodeIndex, selectorIndex, attrs) { if (selectorIndex === void 0) { selectorIndex = 0; } var node = createLNode(nodeIndex, 1 /* Projection */, null, null, attrs || null, null); // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views. if (node.tNode.projection === null) node.tNode.projection = selectorIndex; // `<ng-content>` has no content isParent = false; // re-distribution of projectable nodes is stored on a component's view level var parent = getParentLNode(node); if (canInsertNativeNode(parent, viewData)) { var componentNode = findComponentHost(viewData); var nodeToProject = componentNode.tNode.projection[selectorIndex]; var projectedView = componentNode.view; var projectionNodeIndex = -1; var grandparent = void 0; var renderParent = parent.tNode.type === 2 /* View */ ? (grandparent = getParentLNode(parent)) && grandparent.data[RENDER_PARENT] : parent; while (nodeToProject) { if (nodeToProject.type === 1 /* Projection */) { // This node is re-projected, so we must go up the tree to get its projected nodes. var currentComponentHost = findComponentHost(projectedView); var firstProjectedNode = currentComponentHost.tNode.projection[nodeToProject.projection]; if (firstProjectedNode) { projectionNodeStack$1[++projectionNodeIndex] = projectedView[nodeToProject.index]; nodeToProject = firstProjectedNode; projectedView = currentComponentHost.view; continue; } } else { var lNode = projectedView[nodeToProject.index]; lNode.tNode.flags |= 8192 /* isProjected */; appendProjectedNode(lNode, parent, viewData, renderParent); } // If we are finished with a list of re-projected nodes, we need to get // back to the root projection node that was re-projected. if (nodeToProject.next === null && projectedView !== componentNode.view) { // move down into the view of the component we're projecting right now var lNode = projectionNodeStack$1[projectionNodeIndex--]; nodeToProject = lNode.tNode; projectedView = lNode.view; } nodeToProject = nodeToProject.next; } } }
[ "function", "projection", "(", "nodeIndex", ",", "selectorIndex", ",", "attrs", ")", "{", "if", "(", "selectorIndex", "===", "void", "0", ")", "{", "selectorIndex", "=", "0", ";", "}", "var", "node", "=", "createLNode", "(", "nodeIndex", ",", "1", "/* Projection */", ",", "null", ",", "null", ",", "attrs", "||", "null", ",", "null", ")", ";", "// We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.", "if", "(", "node", ".", "tNode", ".", "projection", "===", "null", ")", "node", ".", "tNode", ".", "projection", "=", "selectorIndex", ";", "// `<ng-content>` has no content", "isParent", "=", "false", ";", "// re-distribution of projectable nodes is stored on a component's view level", "var", "parent", "=", "getParentLNode", "(", "node", ")", ";", "if", "(", "canInsertNativeNode", "(", "parent", ",", "viewData", ")", ")", "{", "var", "componentNode", "=", "findComponentHost", "(", "viewData", ")", ";", "var", "nodeToProject", "=", "componentNode", ".", "tNode", ".", "projection", "[", "selectorIndex", "]", ";", "var", "projectedView", "=", "componentNode", ".", "view", ";", "var", "projectionNodeIndex", "=", "-", "1", ";", "var", "grandparent", "=", "void", "0", ";", "var", "renderParent", "=", "parent", ".", "tNode", ".", "type", "===", "2", "/* View */", "?", "(", "grandparent", "=", "getParentLNode", "(", "parent", ")", ")", "&&", "grandparent", ".", "data", "[", "RENDER_PARENT", "]", ":", "parent", ";", "while", "(", "nodeToProject", ")", "{", "if", "(", "nodeToProject", ".", "type", "===", "1", "/* Projection */", ")", "{", "// This node is re-projected, so we must go up the tree to get its projected nodes.", "var", "currentComponentHost", "=", "findComponentHost", "(", "projectedView", ")", ";", "var", "firstProjectedNode", "=", "currentComponentHost", ".", "tNode", ".", "projection", "[", "nodeToProject", ".", "projection", "]", ";", "if", "(", "firstProjectedNode", ")", "{", "projectionNodeStack$1", "[", "++", "projectionNodeIndex", "]", "=", "projectedView", "[", "nodeToProject", ".", "index", "]", ";", "nodeToProject", "=", "firstProjectedNode", ";", "projectedView", "=", "currentComponentHost", ".", "view", ";", "continue", ";", "}", "}", "else", "{", "var", "lNode", "=", "projectedView", "[", "nodeToProject", ".", "index", "]", ";", "lNode", ".", "tNode", ".", "flags", "|=", "8192", "/* isProjected */", ";", "appendProjectedNode", "(", "lNode", ",", "parent", ",", "viewData", ",", "renderParent", ")", ";", "}", "// If we are finished with a list of re-projected nodes, we need to get", "// back to the root projection node that was re-projected.", "if", "(", "nodeToProject", ".", "next", "===", "null", "&&", "projectedView", "!==", "componentNode", ".", "view", ")", "{", "// move down into the view of the component we're projecting right now", "var", "lNode", "=", "projectionNodeStack$1", "[", "projectionNodeIndex", "--", "]", ";", "nodeToProject", "=", "lNode", ".", "tNode", ";", "projectedView", "=", "lNode", ".", "view", ";", "}", "nodeToProject", "=", "nodeToProject", ".", "next", ";", "}", "}", "}" ]
Inserts previously re-distributed projected nodes. This instruction must be preceded by a call to the projectionDef instruction. @param nodeIndex @param selectorIndex: - 0 when the selector is `*` (or unspecified as this is the default value), - 1 based index of the selector from the {@link projectionDef}
[ "Inserts", "previously", "re", "-", "distributed", "projected", "nodes", ".", "This", "instruction", "must", "be", "preceded", "by", "a", "call", "to", "the", "projectionDef", "instruction", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23224-L23272
11,762
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
addToViewTree
function addToViewTree(currentView, adjustedHostIndex, state) { if (currentView[TAIL]) { currentView[TAIL][NEXT] = state; } else if (firstTemplatePass) { tView.childIndex = adjustedHostIndex; } currentView[TAIL] = state; return state; }
javascript
function addToViewTree(currentView, adjustedHostIndex, state) { if (currentView[TAIL]) { currentView[TAIL][NEXT] = state; } else if (firstTemplatePass) { tView.childIndex = adjustedHostIndex; } currentView[TAIL] = state; return state; }
[ "function", "addToViewTree", "(", "currentView", ",", "adjustedHostIndex", ",", "state", ")", "{", "if", "(", "currentView", "[", "TAIL", "]", ")", "{", "currentView", "[", "TAIL", "]", "[", "NEXT", "]", "=", "state", ";", "}", "else", "if", "(", "firstTemplatePass", ")", "{", "tView", ".", "childIndex", "=", "adjustedHostIndex", ";", "}", "currentView", "[", "TAIL", "]", "=", "state", ";", "return", "state", ";", "}" ]
Adds LViewData or LContainer to the end of the current view tree. This structure will be used to traverse through nested views to remove listeners and call onDestroy callbacks. @param currentView The view where LViewData or LContainer should be added @param adjustedHostIndex Index of the view's host node in LViewData[], adjusted for header @param state The LViewData or LContainer to add to the view tree @returns The state passed in
[ "Adds", "LViewData", "or", "LContainer", "to", "the", "end", "of", "the", "current", "view", "tree", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23284-L23293
11,763
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
wrapListenerWithDirtyAndDefault
function wrapListenerWithDirtyAndDefault(view, listenerFn) { return function wrapListenerIn_markViewDirty(e) { markViewDirty(view); if (listenerFn(e) === false) { e.preventDefault(); // Necessary for legacy browsers that don't support preventDefault (e.g. IE) e.returnValue = false; } }; }
javascript
function wrapListenerWithDirtyAndDefault(view, listenerFn) { return function wrapListenerIn_markViewDirty(e) { markViewDirty(view); if (listenerFn(e) === false) { e.preventDefault(); // Necessary for legacy browsers that don't support preventDefault (e.g. IE) e.returnValue = false; } }; }
[ "function", "wrapListenerWithDirtyAndDefault", "(", "view", ",", "listenerFn", ")", "{", "return", "function", "wrapListenerIn_markViewDirty", "(", "e", ")", "{", "markViewDirty", "(", "view", ")", ";", "if", "(", "listenerFn", "(", "e", ")", "===", "false", ")", "{", "e", ".", "preventDefault", "(", ")", ";", "// Necessary for legacy browsers that don't support preventDefault (e.g. IE)", "e", ".", "returnValue", "=", "false", ";", "}", "}", ";", "}" ]
Wraps an event listener so its host view and its ancestor views will be marked dirty whenever the event fires. Also wraps with preventDefault behavior.
[ "Wraps", "an", "event", "listener", "so", "its", "host", "view", "and", "its", "ancestor", "views", "will", "be", "marked", "dirty", "whenever", "the", "event", "fires", ".", "Also", "wraps", "with", "preventDefault", "behavior", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23318-L23327
11,764
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
markViewDirty
function markViewDirty(view) { var currentView = view; while (currentView[PARENT] != null) { currentView[FLAGS] |= 4 /* Dirty */; currentView = currentView[PARENT]; } currentView[FLAGS] |= 4 /* Dirty */; ngDevMode && assertDefined(currentView[CONTEXT], 'rootContext'); scheduleTick(currentView[CONTEXT]); }
javascript
function markViewDirty(view) { var currentView = view; while (currentView[PARENT] != null) { currentView[FLAGS] |= 4 /* Dirty */; currentView = currentView[PARENT]; } currentView[FLAGS] |= 4 /* Dirty */; ngDevMode && assertDefined(currentView[CONTEXT], 'rootContext'); scheduleTick(currentView[CONTEXT]); }
[ "function", "markViewDirty", "(", "view", ")", "{", "var", "currentView", "=", "view", ";", "while", "(", "currentView", "[", "PARENT", "]", "!=", "null", ")", "{", "currentView", "[", "FLAGS", "]", "|=", "4", "/* Dirty */", ";", "currentView", "=", "currentView", "[", "PARENT", "]", ";", "}", "currentView", "[", "FLAGS", "]", "|=", "4", "/* Dirty */", ";", "ngDevMode", "&&", "assertDefined", "(", "currentView", "[", "CONTEXT", "]", ",", "'rootContext'", ")", ";", "scheduleTick", "(", "currentView", "[", "CONTEXT", "]", ")", ";", "}" ]
Marks current view and all ancestors dirty
[ "Marks", "current", "view", "and", "all", "ancestors", "dirty" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23329-L23338
11,765
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
scheduleTick
function scheduleTick(rootContext) { if (rootContext.clean == _CLEAN_PROMISE) { var res_1; rootContext.clean = new Promise(function (r) { return res_1 = r; }); rootContext.scheduler(function () { tickRootContext(rootContext); res_1(null); rootContext.clean = _CLEAN_PROMISE; }); } }
javascript
function scheduleTick(rootContext) { if (rootContext.clean == _CLEAN_PROMISE) { var res_1; rootContext.clean = new Promise(function (r) { return res_1 = r; }); rootContext.scheduler(function () { tickRootContext(rootContext); res_1(null); rootContext.clean = _CLEAN_PROMISE; }); } }
[ "function", "scheduleTick", "(", "rootContext", ")", "{", "if", "(", "rootContext", ".", "clean", "==", "_CLEAN_PROMISE", ")", "{", "var", "res_1", ";", "rootContext", ".", "clean", "=", "new", "Promise", "(", "function", "(", "r", ")", "{", "return", "res_1", "=", "r", ";", "}", ")", ";", "rootContext", ".", "scheduler", "(", "function", "(", ")", "{", "tickRootContext", "(", "rootContext", ")", ";", "res_1", "(", "null", ")", ";", "rootContext", ".", "clean", "=", "_CLEAN_PROMISE", ";", "}", ")", ";", "}", "}" ]
Used to schedule change detection on the whole application. Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run. It is usually called indirectly by calling `markDirty` when the view needs to be re-rendered. Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple `scheduleTick` requests. The scheduling function can be overridden in `renderComponent`'s `scheduler` option.
[ "Used", "to", "schedule", "change", "detection", "on", "the", "whole", "application", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23350-L23360
11,766
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getRootView
function getRootView(component) { ngDevMode && assertDefined(component, 'component'); var lElementNode = _getComponentHostLElementNode(component); var lViewData = lElementNode.view; while (lViewData[PARENT]) { lViewData = lViewData[PARENT]; } return lViewData; }
javascript
function getRootView(component) { ngDevMode && assertDefined(component, 'component'); var lElementNode = _getComponentHostLElementNode(component); var lViewData = lElementNode.view; while (lViewData[PARENT]) { lViewData = lViewData[PARENT]; } return lViewData; }
[ "function", "getRootView", "(", "component", ")", "{", "ngDevMode", "&&", "assertDefined", "(", "component", ",", "'component'", ")", ";", "var", "lElementNode", "=", "_getComponentHostLElementNode", "(", "component", ")", ";", "var", "lViewData", "=", "lElementNode", ".", "view", ";", "while", "(", "lViewData", "[", "PARENT", "]", ")", "{", "lViewData", "=", "lViewData", "[", "PARENT", "]", ";", "}", "return", "lViewData", ";", "}" ]
Retrieve the root view from any component by walking the parent `LViewData` until reaching the root `LViewData`. @param component any component
[ "Retrieve", "the", "root", "view", "from", "any", "component", "by", "walking", "the", "parent", "LViewData", "until", "reaching", "the", "root", "LViewData", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23375-L23383
11,767
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
detectChangesInternal
function detectChangesInternal(hostView, hostNode, component) { var oldView = enterView(hostView, hostNode); var hostTView = hostView[TVIEW]; var template = hostTView.template; var viewQuery = hostTView.viewQuery; try { namespaceHTML(); createViewQuery(viewQuery, hostView[FLAGS], component); template(getRenderFlags(hostView), component); refreshView(); updateViewQuery(viewQuery, component); } finally { leaveView(oldView); } }
javascript
function detectChangesInternal(hostView, hostNode, component) { var oldView = enterView(hostView, hostNode); var hostTView = hostView[TVIEW]; var template = hostTView.template; var viewQuery = hostTView.viewQuery; try { namespaceHTML(); createViewQuery(viewQuery, hostView[FLAGS], component); template(getRenderFlags(hostView), component); refreshView(); updateViewQuery(viewQuery, component); } finally { leaveView(oldView); } }
[ "function", "detectChangesInternal", "(", "hostView", ",", "hostNode", ",", "component", ")", "{", "var", "oldView", "=", "enterView", "(", "hostView", ",", "hostNode", ")", ";", "var", "hostTView", "=", "hostView", "[", "TVIEW", "]", ";", "var", "template", "=", "hostTView", ".", "template", ";", "var", "viewQuery", "=", "hostTView", ".", "viewQuery", ";", "try", "{", "namespaceHTML", "(", ")", ";", "createViewQuery", "(", "viewQuery", ",", "hostView", "[", "FLAGS", "]", ",", "component", ")", ";", "template", "(", "getRenderFlags", "(", "hostView", ")", ",", "component", ")", ";", "refreshView", "(", ")", ";", "updateViewQuery", "(", "viewQuery", ",", "component", ")", ";", "}", "finally", "{", "leaveView", "(", "oldView", ")", ";", "}", "}" ]
Checks the view of the component provided. Does not gate on dirty checks or execute doCheck.
[ "Checks", "the", "view", "of", "the", "component", "provided", ".", "Does", "not", "gate", "on", "dirty", "checks", "or", "execute", "doCheck", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23419-L23434
11,768
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
initBindings
function initBindings() { ngDevMode && assertEqual(viewData[BINDING_INDEX], -1, 'Binding index should not yet be set ' + viewData[BINDING_INDEX]); if (tView.bindingStartIndex === -1) { tView.bindingStartIndex = viewData.length; } viewData[BINDING_INDEX] = tView.bindingStartIndex; }
javascript
function initBindings() { ngDevMode && assertEqual(viewData[BINDING_INDEX], -1, 'Binding index should not yet be set ' + viewData[BINDING_INDEX]); if (tView.bindingStartIndex === -1) { tView.bindingStartIndex = viewData.length; } viewData[BINDING_INDEX] = tView.bindingStartIndex; }
[ "function", "initBindings", "(", ")", "{", "ngDevMode", "&&", "assertEqual", "(", "viewData", "[", "BINDING_INDEX", "]", ",", "-", "1", ",", "'Binding index should not yet be set '", "+", "viewData", "[", "BINDING_INDEX", "]", ")", ";", "if", "(", "tView", ".", "bindingStartIndex", "===", "-", "1", ")", "{", "tView", ".", "bindingStartIndex", "=", "viewData", ".", "length", ";", "}", "viewData", "[", "BINDING_INDEX", "]", "=", "tView", ".", "bindingStartIndex", ";", "}" ]
Initializes the binding start index. Will get inlined. This function must be called before any binding related function is called (ie `bind()`, `interpolationX()`, `pureFunctionX()`)
[ "Initializes", "the", "binding", "start", "index", ".", "Will", "get", "inlined", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23472-L23478
11,769
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
moveBindingIndexToReservedSlot
function moveBindingIndexToReservedSlot(offset) { var currentSlot = viewData[BINDING_INDEX]; viewData[BINDING_INDEX] = tView.bindingStartIndex - offset; return currentSlot; }
javascript
function moveBindingIndexToReservedSlot(offset) { var currentSlot = viewData[BINDING_INDEX]; viewData[BINDING_INDEX] = tView.bindingStartIndex - offset; return currentSlot; }
[ "function", "moveBindingIndexToReservedSlot", "(", "offset", ")", "{", "var", "currentSlot", "=", "viewData", "[", "BINDING_INDEX", "]", ";", "viewData", "[", "BINDING_INDEX", "]", "=", "tView", ".", "bindingStartIndex", "-", "offset", ";", "return", "currentSlot", ";", "}" ]
Sets up the binding index before executing any `pureFunctionX` instructions. The index must be restored after the pure function is executed {@link reserveSlots}
[ "Sets", "up", "the", "binding", "index", "before", "executing", "any", "pureFunctionX", "instructions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23521-L23525
11,770
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolationV
function interpolationV(values) { ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values'); ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values'); var different = false; for (var i = 1; i < values.length; i += 2) { // Check if bindings (odd indexes) have changed bindingUpdated(values[i]) && (different = true); } if (!different) { return NO_CHANGE; } // Build the updated content var content = values[0]; for (var i = 1; i < values.length; i += 2) { content += stringify$1(values[i]) + values[i + 1]; } return content; }
javascript
function interpolationV(values) { ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values'); ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values'); var different = false; for (var i = 1; i < values.length; i += 2) { // Check if bindings (odd indexes) have changed bindingUpdated(values[i]) && (different = true); } if (!different) { return NO_CHANGE; } // Build the updated content var content = values[0]; for (var i = 1; i < values.length; i += 2) { content += stringify$1(values[i]) + values[i + 1]; } return content; }
[ "function", "interpolationV", "(", "values", ")", "{", "ngDevMode", "&&", "assertLessThan", "(", "2", ",", "values", ".", "length", ",", "'should have at least 3 values'", ")", ";", "ngDevMode", "&&", "assertEqual", "(", "values", ".", "length", "%", "2", ",", "1", ",", "'should have an odd number of values'", ")", ";", "var", "different", "=", "false", ";", "for", "(", "var", "i", "=", "1", ";", "i", "<", "values", ".", "length", ";", "i", "+=", "2", ")", "{", "// Check if bindings (odd indexes) have changed", "bindingUpdated", "(", "values", "[", "i", "]", ")", "&&", "(", "different", "=", "true", ")", ";", "}", "if", "(", "!", "different", ")", "{", "return", "NO_CHANGE", ";", "}", "// Build the updated content", "var", "content", "=", "values", "[", "0", "]", ";", "for", "(", "var", "i", "=", "1", ";", "i", "<", "values", ".", "length", ";", "i", "+=", "2", ")", "{", "content", "+=", "stringify$1", "(", "values", "[", "i", "]", ")", "+", "values", "[", "i", "+", "1", "]", ";", "}", "return", "content", ";", "}" ]
Create interpolation bindings with a variable number of expressions. If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead. Those are faster because there is no need to create an array of expressions and iterate over it. `values`: - has static text at even indexes, - has evaluated expressions at odd indexes. Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
[ "Create", "interpolation", "bindings", "with", "a", "variable", "number", "of", "expressions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23547-L23564
11,771
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolation1
function interpolation1(prefix, v0, suffix) { var different = bindingUpdated(v0); return different ? prefix + stringify$1(v0) + suffix : NO_CHANGE; }
javascript
function interpolation1(prefix, v0, suffix) { var different = bindingUpdated(v0); return different ? prefix + stringify$1(v0) + suffix : NO_CHANGE; }
[ "function", "interpolation1", "(", "prefix", ",", "v0", ",", "suffix", ")", "{", "var", "different", "=", "bindingUpdated", "(", "v0", ")", ";", "return", "different", "?", "prefix", "+", "stringify$1", "(", "v0", ")", "+", "suffix", ":", "NO_CHANGE", ";", "}" ]
Creates an interpolation binding with 1 expression. @param prefix static value used for concatenation only. @param v0 value checked for change. @param suffix static value used for concatenation only.
[ "Creates", "an", "interpolation", "binding", "with", "1", "expression", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23572-L23575
11,772
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolation2
function interpolation2(prefix, v0, i0, v1, suffix) { var different = bindingUpdated2(v0, v1); return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + suffix : NO_CHANGE; }
javascript
function interpolation2(prefix, v0, i0, v1, suffix) { var different = bindingUpdated2(v0, v1); return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + suffix : NO_CHANGE; }
[ "function", "interpolation2", "(", "prefix", ",", "v0", ",", "i0", ",", "v1", ",", "suffix", ")", "{", "var", "different", "=", "bindingUpdated2", "(", "v0", ",", "v1", ")", ";", "return", "different", "?", "prefix", "+", "stringify$1", "(", "v0", ")", "+", "i0", "+", "stringify$1", "(", "v1", ")", "+", "suffix", ":", "NO_CHANGE", ";", "}" ]
Creates an interpolation binding with 2 expressions.
[ "Creates", "an", "interpolation", "binding", "with", "2", "expressions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23577-L23580
11,773
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolation3
function interpolation3(prefix, v0, i0, v1, i1, v2, suffix) { var different = bindingUpdated2(v0, v1); different = bindingUpdated(v2) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + suffix : NO_CHANGE; }
javascript
function interpolation3(prefix, v0, i0, v1, i1, v2, suffix) { var different = bindingUpdated2(v0, v1); different = bindingUpdated(v2) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + suffix : NO_CHANGE; }
[ "function", "interpolation3", "(", "prefix", ",", "v0", ",", "i0", ",", "v1", ",", "i1", ",", "v2", ",", "suffix", ")", "{", "var", "different", "=", "bindingUpdated2", "(", "v0", ",", "v1", ")", ";", "different", "=", "bindingUpdated", "(", "v2", ")", "||", "different", ";", "return", "different", "?", "prefix", "+", "stringify$1", "(", "v0", ")", "+", "i0", "+", "stringify$1", "(", "v1", ")", "+", "i1", "+", "stringify$1", "(", "v2", ")", "+", "suffix", ":", "NO_CHANGE", ";", "}" ]
Creates an interpolation binding with 3 expressions.
[ "Creates", "an", "interpolation", "binding", "with", "3", "expressions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23582-L23587
11,774
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolation4
function interpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + suffix : NO_CHANGE; }
javascript
function interpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + suffix : NO_CHANGE; }
[ "function", "interpolation4", "(", "prefix", ",", "v0", ",", "i0", ",", "v1", ",", "i1", ",", "v2", ",", "i2", ",", "v3", ",", "suffix", ")", "{", "var", "different", "=", "bindingUpdated4", "(", "v0", ",", "v1", ",", "v2", ",", "v3", ")", ";", "return", "different", "?", "prefix", "+", "stringify$1", "(", "v0", ")", "+", "i0", "+", "stringify$1", "(", "v1", ")", "+", "i1", "+", "stringify$1", "(", "v2", ")", "+", "i2", "+", "stringify$1", "(", "v3", ")", "+", "suffix", ":", "NO_CHANGE", ";", "}" ]
Create an interpolation binding with 4 expressions.
[ "Create", "an", "interpolation", "binding", "with", "4", "expressions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23589-L23595
11,775
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolation5
function interpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); different = bindingUpdated(v4) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 + stringify$1(v4) + suffix : NO_CHANGE; }
javascript
function interpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); different = bindingUpdated(v4) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 + stringify$1(v4) + suffix : NO_CHANGE; }
[ "function", "interpolation5", "(", "prefix", ",", "v0", ",", "i0", ",", "v1", ",", "i1", ",", "v2", ",", "i2", ",", "v3", ",", "i3", ",", "v4", ",", "suffix", ")", "{", "var", "different", "=", "bindingUpdated4", "(", "v0", ",", "v1", ",", "v2", ",", "v3", ")", ";", "different", "=", "bindingUpdated", "(", "v4", ")", "||", "different", ";", "return", "different", "?", "prefix", "+", "stringify$1", "(", "v0", ")", "+", "i0", "+", "stringify$1", "(", "v1", ")", "+", "i1", "+", "stringify$1", "(", "v2", ")", "+", "i2", "+", "stringify$1", "(", "v3", ")", "+", "i3", "+", "stringify$1", "(", "v4", ")", "+", "suffix", ":", "NO_CHANGE", ";", "}" ]
Creates an interpolation binding with 5 expressions.
[ "Creates", "an", "interpolation", "binding", "with", "5", "expressions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23597-L23604
11,776
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolation6
function interpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); different = bindingUpdated2(v4, v5) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 + stringify$1(v4) + i4 + stringify$1(v5) + suffix : NO_CHANGE; }
javascript
function interpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); different = bindingUpdated2(v4, v5) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 + stringify$1(v4) + i4 + stringify$1(v5) + suffix : NO_CHANGE; }
[ "function", "interpolation6", "(", "prefix", ",", "v0", ",", "i0", ",", "v1", ",", "i1", ",", "v2", ",", "i2", ",", "v3", ",", "i3", ",", "v4", ",", "i4", ",", "v5", ",", "suffix", ")", "{", "var", "different", "=", "bindingUpdated4", "(", "v0", ",", "v1", ",", "v2", ",", "v3", ")", ";", "different", "=", "bindingUpdated2", "(", "v4", ",", "v5", ")", "||", "different", ";", "return", "different", "?", "prefix", "+", "stringify$1", "(", "v0", ")", "+", "i0", "+", "stringify$1", "(", "v1", ")", "+", "i1", "+", "stringify$1", "(", "v2", ")", "+", "i2", "+", "stringify$1", "(", "v3", ")", "+", "i3", "+", "stringify$1", "(", "v4", ")", "+", "i4", "+", "stringify$1", "(", "v5", ")", "+", "suffix", ":", "NO_CHANGE", ";", "}" ]
Creates an interpolation binding with 6 expressions.
[ "Creates", "an", "interpolation", "binding", "with", "6", "expressions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23606-L23613
11,777
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolation7
function interpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); different = bindingUpdated2(v4, v5) || different; different = bindingUpdated(v6) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 + stringify$1(v4) + i4 + stringify$1(v5) + i5 + stringify$1(v6) + suffix : NO_CHANGE; }
javascript
function interpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); different = bindingUpdated2(v4, v5) || different; different = bindingUpdated(v6) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 + stringify$1(v4) + i4 + stringify$1(v5) + i5 + stringify$1(v6) + suffix : NO_CHANGE; }
[ "function", "interpolation7", "(", "prefix", ",", "v0", ",", "i0", ",", "v1", ",", "i1", ",", "v2", ",", "i2", ",", "v3", ",", "i3", ",", "v4", ",", "i4", ",", "v5", ",", "i5", ",", "v6", ",", "suffix", ")", "{", "var", "different", "=", "bindingUpdated4", "(", "v0", ",", "v1", ",", "v2", ",", "v3", ")", ";", "different", "=", "bindingUpdated2", "(", "v4", ",", "v5", ")", "||", "different", ";", "different", "=", "bindingUpdated", "(", "v6", ")", "||", "different", ";", "return", "different", "?", "prefix", "+", "stringify$1", "(", "v0", ")", "+", "i0", "+", "stringify$1", "(", "v1", ")", "+", "i1", "+", "stringify$1", "(", "v2", ")", "+", "i2", "+", "stringify$1", "(", "v3", ")", "+", "i3", "+", "stringify$1", "(", "v4", ")", "+", "i4", "+", "stringify$1", "(", "v5", ")", "+", "i5", "+", "stringify$1", "(", "v6", ")", "+", "suffix", ":", "NO_CHANGE", ";", "}" ]
Creates an interpolation binding with 7 expressions.
[ "Creates", "an", "interpolation", "binding", "with", "7", "expressions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23615-L23623
11,778
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
interpolation8
function interpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); different = bindingUpdated4(v4, v5, v6, v7) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 + stringify$1(v4) + i4 + stringify$1(v5) + i5 + stringify$1(v6) + i6 + stringify$1(v7) + suffix : NO_CHANGE; }
javascript
function interpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) { var different = bindingUpdated4(v0, v1, v2, v3); different = bindingUpdated4(v4, v5, v6, v7) || different; return different ? prefix + stringify$1(v0) + i0 + stringify$1(v1) + i1 + stringify$1(v2) + i2 + stringify$1(v3) + i3 + stringify$1(v4) + i4 + stringify$1(v5) + i5 + stringify$1(v6) + i6 + stringify$1(v7) + suffix : NO_CHANGE; }
[ "function", "interpolation8", "(", "prefix", ",", "v0", ",", "i0", ",", "v1", ",", "i1", ",", "v2", ",", "i2", ",", "v3", ",", "i3", ",", "v4", ",", "i4", ",", "v5", ",", "i5", ",", "v6", ",", "i6", ",", "v7", ",", "suffix", ")", "{", "var", "different", "=", "bindingUpdated4", "(", "v0", ",", "v1", ",", "v2", ",", "v3", ")", ";", "different", "=", "bindingUpdated4", "(", "v4", ",", "v5", ",", "v6", ",", "v7", ")", "||", "different", ";", "return", "different", "?", "prefix", "+", "stringify$1", "(", "v0", ")", "+", "i0", "+", "stringify$1", "(", "v1", ")", "+", "i1", "+", "stringify$1", "(", "v2", ")", "+", "i2", "+", "stringify$1", "(", "v3", ")", "+", "i3", "+", "stringify$1", "(", "v4", ")", "+", "i4", "+", "stringify$1", "(", "v5", ")", "+", "i5", "+", "stringify$1", "(", "v6", ")", "+", "i6", "+", "stringify$1", "(", "v7", ")", "+", "suffix", ":", "NO_CHANGE", ";", "}" ]
Creates an interpolation binding with 8 expressions.
[ "Creates", "an", "interpolation", "binding", "with", "8", "expressions", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23625-L23632
11,779
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
store
function store(index, value) { // We don't store any static data for local variables, so the first time // we see the template, we should store as null to avoid a sparse array var adjustedIndex = index + HEADER_OFFSET; if (adjustedIndex >= tView.data.length) { tView.data[adjustedIndex] = null; } viewData[adjustedIndex] = value; }
javascript
function store(index, value) { // We don't store any static data for local variables, so the first time // we see the template, we should store as null to avoid a sparse array var adjustedIndex = index + HEADER_OFFSET; if (adjustedIndex >= tView.data.length) { tView.data[adjustedIndex] = null; } viewData[adjustedIndex] = value; }
[ "function", "store", "(", "index", ",", "value", ")", "{", "// We don't store any static data for local variables, so the first time", "// we see the template, we should store as null to avoid a sparse array", "var", "adjustedIndex", "=", "index", "+", "HEADER_OFFSET", ";", "if", "(", "adjustedIndex", ">=", "tView", ".", "data", ".", "length", ")", "{", "tView", ".", "data", "[", "adjustedIndex", "]", "=", "null", ";", "}", "viewData", "[", "adjustedIndex", "]", "=", "value", ";", "}" ]
Store a value in the `data` at a given `index`.
[ "Store", "a", "value", "in", "the", "data", "at", "a", "given", "index", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23634-L23642
11,780
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
loadDirective
function loadDirective(index) { ngDevMode && assertDefined(directives, 'Directives array should be defined if reading a dir.'); ngDevMode && assertDataInRange(index, directives); return directives[index]; }
javascript
function loadDirective(index) { ngDevMode && assertDefined(directives, 'Directives array should be defined if reading a dir.'); ngDevMode && assertDataInRange(index, directives); return directives[index]; }
[ "function", "loadDirective", "(", "index", ")", "{", "ngDevMode", "&&", "assertDefined", "(", "directives", ",", "'Directives array should be defined if reading a dir.'", ")", ";", "ngDevMode", "&&", "assertDataInRange", "(", "index", ",", "directives", ")", ";", "return", "directives", "[", "index", "]", ";", "}" ]
Retrieves a value from the `directives` array.
[ "Retrieves", "a", "value", "from", "the", "directives", "array", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23644-L23648
11,781
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
consumeBinding
function consumeBinding() { ngDevMode && assertDataInRange(viewData[BINDING_INDEX]); ngDevMode && assertNotEqual(viewData[viewData[BINDING_INDEX]], NO_CHANGE, 'Stored value should never be NO_CHANGE.'); return viewData[viewData[BINDING_INDEX]++]; }
javascript
function consumeBinding() { ngDevMode && assertDataInRange(viewData[BINDING_INDEX]); ngDevMode && assertNotEqual(viewData[viewData[BINDING_INDEX]], NO_CHANGE, 'Stored value should never be NO_CHANGE.'); return viewData[viewData[BINDING_INDEX]++]; }
[ "function", "consumeBinding", "(", ")", "{", "ngDevMode", "&&", "assertDataInRange", "(", "viewData", "[", "BINDING_INDEX", "]", ")", ";", "ngDevMode", "&&", "assertNotEqual", "(", "viewData", "[", "viewData", "[", "BINDING_INDEX", "]", "]", ",", "NO_CHANGE", ",", "'Stored value should never be NO_CHANGE.'", ")", ";", "return", "viewData", "[", "viewData", "[", "BINDING_INDEX", "]", "++", "]", ";", "}" ]
Gets the current binding value and increments the binding index.
[ "Gets", "the", "current", "binding", "value", "and", "increments", "the", "binding", "index", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23662-L23667
11,782
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
bindingUpdated
function bindingUpdated(value) { ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.'); if (viewData[BINDING_INDEX] === -1) initBindings(); var bindingIndex = viewData[BINDING_INDEX]; if (bindingIndex >= viewData.length) { viewData[viewData[BINDING_INDEX]++] = value; } else if (isDifferent(viewData[bindingIndex], value)) { throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, viewData[bindingIndex], value); viewData[viewData[BINDING_INDEX]++] = value; } else { viewData[BINDING_INDEX]++; return false; } return true; }
javascript
function bindingUpdated(value) { ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.'); if (viewData[BINDING_INDEX] === -1) initBindings(); var bindingIndex = viewData[BINDING_INDEX]; if (bindingIndex >= viewData.length) { viewData[viewData[BINDING_INDEX]++] = value; } else if (isDifferent(viewData[bindingIndex], value)) { throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, viewData[bindingIndex], value); viewData[viewData[BINDING_INDEX]++] = value; } else { viewData[BINDING_INDEX]++; return false; } return true; }
[ "function", "bindingUpdated", "(", "value", ")", "{", "ngDevMode", "&&", "assertNotEqual", "(", "value", ",", "NO_CHANGE", ",", "'Incoming value should never be NO_CHANGE.'", ")", ";", "if", "(", "viewData", "[", "BINDING_INDEX", "]", "===", "-", "1", ")", "initBindings", "(", ")", ";", "var", "bindingIndex", "=", "viewData", "[", "BINDING_INDEX", "]", ";", "if", "(", "bindingIndex", ">=", "viewData", ".", "length", ")", "{", "viewData", "[", "viewData", "[", "BINDING_INDEX", "]", "++", "]", "=", "value", ";", "}", "else", "if", "(", "isDifferent", "(", "viewData", "[", "bindingIndex", "]", ",", "value", ")", ")", "{", "throwErrorIfNoChangesMode", "(", "creationMode", ",", "checkNoChangesMode", ",", "viewData", "[", "bindingIndex", "]", ",", "value", ")", ";", "viewData", "[", "viewData", "[", "BINDING_INDEX", "]", "++", "]", "=", "value", ";", "}", "else", "{", "viewData", "[", "BINDING_INDEX", "]", "++", ";", "return", "false", ";", "}", "return", "true", ";", "}" ]
Updates binding if changed, then returns whether it was updated.
[ "Updates", "binding", "if", "changed", "then", "returns", "whether", "it", "was", "updated", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23669-L23686
11,783
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
bindingUpdated4
function bindingUpdated4(exp1, exp2, exp3, exp4) { var different = bindingUpdated2(exp1, exp2); return bindingUpdated2(exp3, exp4) || different; }
javascript
function bindingUpdated4(exp1, exp2, exp3, exp4) { var different = bindingUpdated2(exp1, exp2); return bindingUpdated2(exp3, exp4) || different; }
[ "function", "bindingUpdated4", "(", "exp1", ",", "exp2", ",", "exp3", ",", "exp4", ")", "{", "var", "different", "=", "bindingUpdated2", "(", "exp1", ",", "exp2", ")", ";", "return", "bindingUpdated2", "(", "exp3", ",", "exp4", ")", "||", "different", ";", "}" ]
Updates 4 bindings if changed, then returns whether any was updated.
[ "Updates", "4", "bindings", "if", "changed", "then", "returns", "whether", "any", "was", "updated", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23698-L23701
11,784
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
assertReservedSlotInitialized
function assertReservedSlotInitialized(slotOffset, numSlots) { if (firstTemplatePass) { var startIndex = tView.bindingStartIndex - slotOffset; for (var i = 0; i < numSlots; i++) { assertEqual(viewData[startIndex + i], NO_CHANGE, 'The reserved slots should be set to `NO_CHANGE` on first template pass'); } } }
javascript
function assertReservedSlotInitialized(slotOffset, numSlots) { if (firstTemplatePass) { var startIndex = tView.bindingStartIndex - slotOffset; for (var i = 0; i < numSlots; i++) { assertEqual(viewData[startIndex + i], NO_CHANGE, 'The reserved slots should be set to `NO_CHANGE` on first template pass'); } } }
[ "function", "assertReservedSlotInitialized", "(", "slotOffset", ",", "numSlots", ")", "{", "if", "(", "firstTemplatePass", ")", "{", "var", "startIndex", "=", "tView", ".", "bindingStartIndex", "-", "slotOffset", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "numSlots", ";", "i", "++", ")", "{", "assertEqual", "(", "viewData", "[", "startIndex", "+", "i", "]", ",", "NO_CHANGE", ",", "'The reserved slots should be set to `NO_CHANGE` on first template pass'", ")", ";", "}", "}", "}" ]
On the first template pass, the reserved slots should be set `NO_CHANGE`. If not, they might not have been actually reserved.
[ "On", "the", "first", "template", "pass", "the", "reserved", "slots", "should", "be", "set", "NO_CHANGE", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23741-L23748
11,785
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
LifecycleHooksFeature
function LifecycleHooksFeature(component, def) { var elementNode = _getComponentHostLElementNode(component); // Root component is always created at dir index 0 var tView = elementNode.view[TVIEW]; queueInitHooks(0, def.onInit, def.doCheck, tView); queueLifecycleHooks(elementNode.tNode.flags, tView); }
javascript
function LifecycleHooksFeature(component, def) { var elementNode = _getComponentHostLElementNode(component); // Root component is always created at dir index 0 var tView = elementNode.view[TVIEW]; queueInitHooks(0, def.onInit, def.doCheck, tView); queueLifecycleHooks(elementNode.tNode.flags, tView); }
[ "function", "LifecycleHooksFeature", "(", "component", ",", "def", ")", "{", "var", "elementNode", "=", "_getComponentHostLElementNode", "(", "component", ")", ";", "// Root component is always created at dir index 0", "var", "tView", "=", "elementNode", ".", "view", "[", "TVIEW", "]", ";", "queueInitHooks", "(", "0", ",", "def", ".", "onInit", ",", "def", ".", "doCheck", ",", "tView", ")", ";", "queueLifecycleHooks", "(", "elementNode", ".", "tNode", ".", "flags", ",", "tView", ")", ";", "}" ]
Used to enable lifecycle hooks on the root component. Include this feature when calling `renderComponent` if the root component you are rendering has lifecycle hooks defined. Otherwise, the hooks won't be called properly. Example: ``` renderComponent(AppComponent, {features: [RootLifecycleHooks]}); ```
[ "Used", "to", "enable", "lifecycle", "hooks", "on", "the", "root", "component", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23835-L23841
11,786
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getRootContext
function getRootContext(component) { var rootContext = getRootView(component)[CONTEXT]; ngDevMode && assertDefined(rootContext, 'rootContext'); return rootContext; }
javascript
function getRootContext(component) { var rootContext = getRootView(component)[CONTEXT]; ngDevMode && assertDefined(rootContext, 'rootContext'); return rootContext; }
[ "function", "getRootContext", "(", "component", ")", "{", "var", "rootContext", "=", "getRootView", "(", "component", ")", "[", "CONTEXT", "]", ";", "ngDevMode", "&&", "assertDefined", "(", "rootContext", ",", "'rootContext'", ")", ";", "return", "rootContext", ";", "}" ]
Retrieve the root context for any component by walking the parent `LView` until reaching the root `LView`. @param component any component
[ "Retrieve", "the", "root", "context", "for", "any", "component", "by", "walking", "the", "parent", "LView", "until", "reaching", "the", "root", "LView", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L23848-L23852
11,787
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
invertObject
function invertObject(obj, secondary) { if (obj == null) return EMPTY$1; var newLookup = {}; for (var minifiedKey in obj) { if (obj.hasOwnProperty(minifiedKey)) { var publicName = obj[minifiedKey]; var declaredName = publicName; if (Array.isArray(publicName)) { declaredName = publicName[1]; publicName = publicName[0]; } newLookup[publicName] = minifiedKey; if (secondary) { (secondary[declaredName] = minifiedKey); } } } return newLookup; }
javascript
function invertObject(obj, secondary) { if (obj == null) return EMPTY$1; var newLookup = {}; for (var minifiedKey in obj) { if (obj.hasOwnProperty(minifiedKey)) { var publicName = obj[minifiedKey]; var declaredName = publicName; if (Array.isArray(publicName)) { declaredName = publicName[1]; publicName = publicName[0]; } newLookup[publicName] = minifiedKey; if (secondary) { (secondary[declaredName] = minifiedKey); } } } return newLookup; }
[ "function", "invertObject", "(", "obj", ",", "secondary", ")", "{", "if", "(", "obj", "==", "null", ")", "return", "EMPTY$1", ";", "var", "newLookup", "=", "{", "}", ";", "for", "(", "var", "minifiedKey", "in", "obj", ")", "{", "if", "(", "obj", ".", "hasOwnProperty", "(", "minifiedKey", ")", ")", "{", "var", "publicName", "=", "obj", "[", "minifiedKey", "]", ";", "var", "declaredName", "=", "publicName", ";", "if", "(", "Array", ".", "isArray", "(", "publicName", ")", ")", "{", "declaredName", "=", "publicName", "[", "1", "]", ";", "publicName", "=", "publicName", "[", "0", "]", ";", "}", "newLookup", "[", "publicName", "]", "=", "minifiedKey", ";", "if", "(", "secondary", ")", "{", "(", "secondary", "[", "declaredName", "]", "=", "minifiedKey", ")", ";", "}", "}", "}", "return", "newLookup", ";", "}" ]
Inverts an inputs or outputs lookup such that the keys, which were the minified keys, are part of the values, and the values are parsed so that the publicName of the property is the new key e.g. for ``` class Comp { @Input() propName1: string; @Input('publicName') propName2: number; } ``` will be serialized as ``` { a0: 'propName1', b1: ['publicName', 'propName2'], } ``` becomes ``` { 'propName1': 'a0', 'publicName': 'b1' } ``` Optionally the function can take `secondary` which will result in: ``` { 'propName1': 'a0', 'propName2': 'b1' } ```
[ "Inverts", "an", "inputs", "or", "outputs", "lookup", "such", "that", "the", "keys", "which", "were", "the", "minified", "keys", "are", "part", "of", "the", "values", "and", "the", "values", "are", "parsed", "so", "that", "the", "publicName", "of", "the", "property", "is", "the", "new", "key" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L24009-L24028
11,788
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
definePipe
function definePipe(pipeDef) { return { name: pipeDef.name, factory: pipeDef.factory, pure: pipeDef.pure !== false, onDestroy: pipeDef.type.prototype.ngOnDestroy || null }; }
javascript
function definePipe(pipeDef) { return { name: pipeDef.name, factory: pipeDef.factory, pure: pipeDef.pure !== false, onDestroy: pipeDef.type.prototype.ngOnDestroy || null }; }
[ "function", "definePipe", "(", "pipeDef", ")", "{", "return", "{", "name", ":", "pipeDef", ".", "name", ",", "factory", ":", "pipeDef", ".", "factory", ",", "pure", ":", "pipeDef", ".", "pure", "!==", "false", ",", "onDestroy", ":", "pipeDef", ".", "type", ".", "prototype", ".", "ngOnDestroy", "||", "null", "}", ";", "}" ]
Create a pipe definition object. # Example ``` class MyPipe implements PipeTransform { // Generated by Angular Template Compiler static ngPipeDef = definePipe({ ... }); } ``` @param pipeDef Pipe definition generated by the compiler
[ "Create", "a", "pipe", "definition", "object", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L24058-L24065
11,789
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
NgOnChangesFeature
function NgOnChangesFeature(definition) { var declaredToMinifiedInputs = definition.declaredInputs; var proto = definition.type.prototype; var _loop_1 = function (declaredName) { if (declaredToMinifiedInputs.hasOwnProperty(declaredName)) { var minifiedKey = declaredToMinifiedInputs[declaredName]; var privateMinKey_1 = PRIVATE_PREFIX + minifiedKey; // Walk the prototype chain to see if we find a property descriptor // That way we can honor setters and getters that were inherited. var originalProperty = undefined; var checkProto = proto; while (!originalProperty && checkProto && Object.getPrototypeOf(checkProto) !== Object.getPrototypeOf(Object.prototype)) { originalProperty = Object.getOwnPropertyDescriptor(checkProto, minifiedKey); checkProto = Object.getPrototypeOf(checkProto); } var getter = originalProperty && originalProperty.get; var setter_1 = originalProperty && originalProperty.set; // create a getter and setter for property Object.defineProperty(proto, minifiedKey, { get: getter || (setter_1 ? undefined : function () { return this[privateMinKey_1]; }), set: function (value) { var simpleChanges = this[PRIVATE_PREFIX]; if (!simpleChanges) { simpleChanges = {}; // Place where we will store SimpleChanges if there is a change Object.defineProperty(this, PRIVATE_PREFIX, { value: simpleChanges, writable: true }); } var isFirstChange = !this.hasOwnProperty(privateMinKey_1); var currentChange = simpleChanges[declaredName]; if (currentChange) { currentChange.currentValue = value; } else { simpleChanges[declaredName] = new SimpleChange(this[privateMinKey_1], value, isFirstChange); } if (isFirstChange) { // Create a place where the actual value will be stored and make it non-enumerable Object.defineProperty(this, privateMinKey_1, { value: value, writable: true }); } else { this[privateMinKey_1] = value; } if (setter_1) setter_1.call(this, value); } }); } }; for (var declaredName in declaredToMinifiedInputs) { _loop_1(declaredName); } // If an onInit hook is defined, it will need to wrap the ngOnChanges call // so the call order is changes-init-check in creation mode. In subsequent // change detection runs, only the check wrapper will be called. if (definition.onInit != null) { definition.onInit = onChangesWrapper(definition.onInit); } definition.doCheck = onChangesWrapper(definition.doCheck); }
javascript
function NgOnChangesFeature(definition) { var declaredToMinifiedInputs = definition.declaredInputs; var proto = definition.type.prototype; var _loop_1 = function (declaredName) { if (declaredToMinifiedInputs.hasOwnProperty(declaredName)) { var minifiedKey = declaredToMinifiedInputs[declaredName]; var privateMinKey_1 = PRIVATE_PREFIX + minifiedKey; // Walk the prototype chain to see if we find a property descriptor // That way we can honor setters and getters that were inherited. var originalProperty = undefined; var checkProto = proto; while (!originalProperty && checkProto && Object.getPrototypeOf(checkProto) !== Object.getPrototypeOf(Object.prototype)) { originalProperty = Object.getOwnPropertyDescriptor(checkProto, minifiedKey); checkProto = Object.getPrototypeOf(checkProto); } var getter = originalProperty && originalProperty.get; var setter_1 = originalProperty && originalProperty.set; // create a getter and setter for property Object.defineProperty(proto, minifiedKey, { get: getter || (setter_1 ? undefined : function () { return this[privateMinKey_1]; }), set: function (value) { var simpleChanges = this[PRIVATE_PREFIX]; if (!simpleChanges) { simpleChanges = {}; // Place where we will store SimpleChanges if there is a change Object.defineProperty(this, PRIVATE_PREFIX, { value: simpleChanges, writable: true }); } var isFirstChange = !this.hasOwnProperty(privateMinKey_1); var currentChange = simpleChanges[declaredName]; if (currentChange) { currentChange.currentValue = value; } else { simpleChanges[declaredName] = new SimpleChange(this[privateMinKey_1], value, isFirstChange); } if (isFirstChange) { // Create a place where the actual value will be stored and make it non-enumerable Object.defineProperty(this, privateMinKey_1, { value: value, writable: true }); } else { this[privateMinKey_1] = value; } if (setter_1) setter_1.call(this, value); } }); } }; for (var declaredName in declaredToMinifiedInputs) { _loop_1(declaredName); } // If an onInit hook is defined, it will need to wrap the ngOnChanges call // so the call order is changes-init-check in creation mode. In subsequent // change detection runs, only the check wrapper will be called. if (definition.onInit != null) { definition.onInit = onChangesWrapper(definition.onInit); } definition.doCheck = onChangesWrapper(definition.doCheck); }
[ "function", "NgOnChangesFeature", "(", "definition", ")", "{", "var", "declaredToMinifiedInputs", "=", "definition", ".", "declaredInputs", ";", "var", "proto", "=", "definition", ".", "type", ".", "prototype", ";", "var", "_loop_1", "=", "function", "(", "declaredName", ")", "{", "if", "(", "declaredToMinifiedInputs", ".", "hasOwnProperty", "(", "declaredName", ")", ")", "{", "var", "minifiedKey", "=", "declaredToMinifiedInputs", "[", "declaredName", "]", ";", "var", "privateMinKey_1", "=", "PRIVATE_PREFIX", "+", "minifiedKey", ";", "// Walk the prototype chain to see if we find a property descriptor", "// That way we can honor setters and getters that were inherited.", "var", "originalProperty", "=", "undefined", ";", "var", "checkProto", "=", "proto", ";", "while", "(", "!", "originalProperty", "&&", "checkProto", "&&", "Object", ".", "getPrototypeOf", "(", "checkProto", ")", "!==", "Object", ".", "getPrototypeOf", "(", "Object", ".", "prototype", ")", ")", "{", "originalProperty", "=", "Object", ".", "getOwnPropertyDescriptor", "(", "checkProto", ",", "minifiedKey", ")", ";", "checkProto", "=", "Object", ".", "getPrototypeOf", "(", "checkProto", ")", ";", "}", "var", "getter", "=", "originalProperty", "&&", "originalProperty", ".", "get", ";", "var", "setter_1", "=", "originalProperty", "&&", "originalProperty", ".", "set", ";", "// create a getter and setter for property", "Object", ".", "defineProperty", "(", "proto", ",", "minifiedKey", ",", "{", "get", ":", "getter", "||", "(", "setter_1", "?", "undefined", ":", "function", "(", ")", "{", "return", "this", "[", "privateMinKey_1", "]", ";", "}", ")", ",", "set", ":", "function", "(", "value", ")", "{", "var", "simpleChanges", "=", "this", "[", "PRIVATE_PREFIX", "]", ";", "if", "(", "!", "simpleChanges", ")", "{", "simpleChanges", "=", "{", "}", ";", "// Place where we will store SimpleChanges if there is a change", "Object", ".", "defineProperty", "(", "this", ",", "PRIVATE_PREFIX", ",", "{", "value", ":", "simpleChanges", ",", "writable", ":", "true", "}", ")", ";", "}", "var", "isFirstChange", "=", "!", "this", ".", "hasOwnProperty", "(", "privateMinKey_1", ")", ";", "var", "currentChange", "=", "simpleChanges", "[", "declaredName", "]", ";", "if", "(", "currentChange", ")", "{", "currentChange", ".", "currentValue", "=", "value", ";", "}", "else", "{", "simpleChanges", "[", "declaredName", "]", "=", "new", "SimpleChange", "(", "this", "[", "privateMinKey_1", "]", ",", "value", ",", "isFirstChange", ")", ";", "}", "if", "(", "isFirstChange", ")", "{", "// Create a place where the actual value will be stored and make it non-enumerable", "Object", ".", "defineProperty", "(", "this", ",", "privateMinKey_1", ",", "{", "value", ":", "value", ",", "writable", ":", "true", "}", ")", ";", "}", "else", "{", "this", "[", "privateMinKey_1", "]", "=", "value", ";", "}", "if", "(", "setter_1", ")", "setter_1", ".", "call", "(", "this", ",", "value", ")", ";", "}", "}", ")", ";", "}", "}", ";", "for", "(", "var", "declaredName", "in", "declaredToMinifiedInputs", ")", "{", "_loop_1", "(", "declaredName", ")", ";", "}", "// If an onInit hook is defined, it will need to wrap the ngOnChanges call", "// so the call order is changes-init-check in creation mode. In subsequent", "// change detection runs, only the check wrapper will be called.", "if", "(", "definition", ".", "onInit", "!=", "null", ")", "{", "definition", ".", "onInit", "=", "onChangesWrapper", "(", "definition", ".", "onInit", ")", ";", "}", "definition", ".", "doCheck", "=", "onChangesWrapper", "(", "definition", ".", "doCheck", ")", ";", "}" ]
The NgOnChangesFeature decorates a component with support for the ngOnChanges lifecycle hook, so it should be included in any component that implements that hook. If the component or directive uses inheritance, the NgOnChangesFeature MUST be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise inherited properties will not be propagated to the ngOnChanges lifecycle hook. Example usage: ``` static ngComponentDef = defineComponent({ ... inputs: {name: 'publicName'}, features: [NgOnChangesFeature] }); ```
[ "The", "NgOnChangesFeature", "decorates", "a", "component", "with", "support", "for", "the", "ngOnChanges", "lifecycle", "hook", "so", "it", "should", "be", "included", "in", "any", "component", "that", "implements", "that", "hook", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L24216-L24277
11,790
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
bloomAdd
function bloomAdd(injector, type) { var id = type[NG_ELEMENT_ID]; // Set a unique ID on the directive type, so if something tries to inject the directive, // we can easily retrieve the ID and hash it into the bloom bit that should be checked. if (id == null) { id = type[NG_ELEMENT_ID] = nextNgElementId++; } // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each), // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter. // This means that after 255, some directives will share slots, leading to some false positives // when checking for a directive's presence. var bloomBit = id % BLOOM_SIZE; // Create a mask that targets the specific bit associated with the directive. // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding // to bit positions 0 - 31 in a 32 bit integer. var mask = 1 << bloomBit; // Use the raw bloomBit number to determine which bloom filter bucket we should check // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc if (bloomBit < 128) { // Then use the mask to flip on the bit (0-31) associated with the directive in that bucket bloomBit < 64 ? (bloomBit < 32 ? (injector.bf0 |= mask) : (injector.bf1 |= mask)) : (bloomBit < 96 ? (injector.bf2 |= mask) : (injector.bf3 |= mask)); } else { bloomBit < 192 ? (bloomBit < 160 ? (injector.bf4 |= mask) : (injector.bf5 |= mask)) : (bloomBit < 224 ? (injector.bf6 |= mask) : (injector.bf7 |= mask)); } }
javascript
function bloomAdd(injector, type) { var id = type[NG_ELEMENT_ID]; // Set a unique ID on the directive type, so if something tries to inject the directive, // we can easily retrieve the ID and hash it into the bloom bit that should be checked. if (id == null) { id = type[NG_ELEMENT_ID] = nextNgElementId++; } // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each), // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter. // This means that after 255, some directives will share slots, leading to some false positives // when checking for a directive's presence. var bloomBit = id % BLOOM_SIZE; // Create a mask that targets the specific bit associated with the directive. // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding // to bit positions 0 - 31 in a 32 bit integer. var mask = 1 << bloomBit; // Use the raw bloomBit number to determine which bloom filter bucket we should check // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc if (bloomBit < 128) { // Then use the mask to flip on the bit (0-31) associated with the directive in that bucket bloomBit < 64 ? (bloomBit < 32 ? (injector.bf0 |= mask) : (injector.bf1 |= mask)) : (bloomBit < 96 ? (injector.bf2 |= mask) : (injector.bf3 |= mask)); } else { bloomBit < 192 ? (bloomBit < 160 ? (injector.bf4 |= mask) : (injector.bf5 |= mask)) : (bloomBit < 224 ? (injector.bf6 |= mask) : (injector.bf7 |= mask)); } }
[ "function", "bloomAdd", "(", "injector", ",", "type", ")", "{", "var", "id", "=", "type", "[", "NG_ELEMENT_ID", "]", ";", "// Set a unique ID on the directive type, so if something tries to inject the directive,", "// we can easily retrieve the ID and hash it into the bloom bit that should be checked.", "if", "(", "id", "==", "null", ")", "{", "id", "=", "type", "[", "NG_ELEMENT_ID", "]", "=", "nextNgElementId", "++", ";", "}", "// We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),", "// so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.", "// This means that after 255, some directives will share slots, leading to some false positives", "// when checking for a directive's presence.", "var", "bloomBit", "=", "id", "%", "BLOOM_SIZE", ";", "// Create a mask that targets the specific bit associated with the directive.", "// JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding", "// to bit positions 0 - 31 in a 32 bit integer.", "var", "mask", "=", "1", "<<", "bloomBit", ";", "// Use the raw bloomBit number to determine which bloom filter bucket we should check", "// e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc", "if", "(", "bloomBit", "<", "128", ")", "{", "// Then use the mask to flip on the bit (0-31) associated with the directive in that bucket", "bloomBit", "<", "64", "?", "(", "bloomBit", "<", "32", "?", "(", "injector", ".", "bf0", "|=", "mask", ")", ":", "(", "injector", ".", "bf1", "|=", "mask", ")", ")", ":", "(", "bloomBit", "<", "96", "?", "(", "injector", ".", "bf2", "|=", "mask", ")", ":", "(", "injector", ".", "bf3", "|=", "mask", ")", ")", ";", "}", "else", "{", "bloomBit", "<", "192", "?", "(", "bloomBit", "<", "160", "?", "(", "injector", ".", "bf4", "|=", "mask", ")", ":", "(", "injector", ".", "bf5", "|=", "mask", ")", ")", ":", "(", "bloomBit", "<", "224", "?", "(", "injector", ".", "bf6", "|=", "mask", ")", ":", "(", "injector", ".", "bf7", "|=", "mask", ")", ")", ";", "}", "}" ]
Registers this directive as present in its node's injector by flipping the directive's corresponding bit in the injector's bloom filter. @param injector The node injector in which the directive should be registered @param type The directive to register
[ "Registers", "this", "directive", "as", "present", "in", "its", "node", "s", "injector", "by", "flipping", "the", "directive", "s", "corresponding", "bit", "in", "the", "injector", "s", "bloom", "filter", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L24714-L24741
11,791
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
injectAttribute
function injectAttribute(attrNameToInject) { ngDevMode && assertPreviousIsParent(); var lElement = getPreviousOrParentNode(); ngDevMode && assertNodeType(lElement, 3 /* Element */); var tElement = lElement.tNode; ngDevMode && assertDefined(tElement, 'expecting tNode'); var attrs = tElement.attrs; if (attrs) { for (var i = 0; i < attrs.length; i = i + 2) { var attrName = attrs[i]; if (attrName === 1 /* SelectOnly */) break; if (attrName == attrNameToInject) { return attrs[i + 1]; } } } return undefined; }
javascript
function injectAttribute(attrNameToInject) { ngDevMode && assertPreviousIsParent(); var lElement = getPreviousOrParentNode(); ngDevMode && assertNodeType(lElement, 3 /* Element */); var tElement = lElement.tNode; ngDevMode && assertDefined(tElement, 'expecting tNode'); var attrs = tElement.attrs; if (attrs) { for (var i = 0; i < attrs.length; i = i + 2) { var attrName = attrs[i]; if (attrName === 1 /* SelectOnly */) break; if (attrName == attrNameToInject) { return attrs[i + 1]; } } } return undefined; }
[ "function", "injectAttribute", "(", "attrNameToInject", ")", "{", "ngDevMode", "&&", "assertPreviousIsParent", "(", ")", ";", "var", "lElement", "=", "getPreviousOrParentNode", "(", ")", ";", "ngDevMode", "&&", "assertNodeType", "(", "lElement", ",", "3", "/* Element */", ")", ";", "var", "tElement", "=", "lElement", ".", "tNode", ";", "ngDevMode", "&&", "assertDefined", "(", "tElement", ",", "'expecting tNode'", ")", ";", "var", "attrs", "=", "tElement", ".", "attrs", ";", "if", "(", "attrs", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "attrs", ".", "length", ";", "i", "=", "i", "+", "2", ")", "{", "var", "attrName", "=", "attrs", "[", "i", "]", ";", "if", "(", "attrName", "===", "1", "/* SelectOnly */", ")", "break", ";", "if", "(", "attrName", "==", "attrNameToInject", ")", "{", "return", "attrs", "[", "i", "+", "1", "]", ";", "}", "}", "}", "return", "undefined", ";", "}" ]
Inject static attribute value into directive constructor. This method is used with `factory` functions which are generated as part of `defineDirective` or `defineComponent`. The method retrieves the static value of an attribute. (Dynamic attributes are not supported since they are not resolved at the time of injection and can change over time.) # Example Given: ``` @Component(...) class MyComponent { constructor(@Attribute('title') title: string) { ... } } ``` When instantiated with ``` <my-component title="Hello"></my-component> ``` Then factory method generated is: ``` MyComponent.ngComponentDef = defineComponent({ factory: () => new MyComponent(injectAttribute('title')) ... }) ``` @experimental
[ "Inject", "static", "attribute", "value", "into", "directive", "constructor", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L24868-L24886
11,792
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getOrCreateHostChangeDetector
function getOrCreateHostChangeDetector(currentNode) { var hostNode = getClosestComponentAncestor(currentNode); var hostInjector = hostNode.nodeInjector; var existingRef = hostInjector && hostInjector.changeDetectorRef; return existingRef ? existingRef : new ViewRef$1(hostNode.data, hostNode .view[DIRECTIVES][hostNode.tNode.flags >> 14 /* DirectiveStartingIndexShift */]); }
javascript
function getOrCreateHostChangeDetector(currentNode) { var hostNode = getClosestComponentAncestor(currentNode); var hostInjector = hostNode.nodeInjector; var existingRef = hostInjector && hostInjector.changeDetectorRef; return existingRef ? existingRef : new ViewRef$1(hostNode.data, hostNode .view[DIRECTIVES][hostNode.tNode.flags >> 14 /* DirectiveStartingIndexShift */]); }
[ "function", "getOrCreateHostChangeDetector", "(", "currentNode", ")", "{", "var", "hostNode", "=", "getClosestComponentAncestor", "(", "currentNode", ")", ";", "var", "hostInjector", "=", "hostNode", ".", "nodeInjector", ";", "var", "existingRef", "=", "hostInjector", "&&", "hostInjector", ".", "changeDetectorRef", ";", "return", "existingRef", "?", "existingRef", ":", "new", "ViewRef$1", "(", "hostNode", ".", "data", ",", "hostNode", ".", "view", "[", "DIRECTIVES", "]", "[", "hostNode", ".", "tNode", ".", "flags", ">>", "14", "/* DirectiveStartingIndexShift */", "]", ")", ";", "}" ]
Gets or creates ChangeDetectorRef for the closest host component
[ "Gets", "or", "creates", "ChangeDetectorRef", "for", "the", "closest", "host", "component" ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L24906-L24914
11,793
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getClosestComponentAncestor
function getClosestComponentAncestor(node) { while (node.tNode.type === 2 /* View */) { node = node.view[HOST_NODE]; } return node; }
javascript
function getClosestComponentAncestor(node) { while (node.tNode.type === 2 /* View */) { node = node.view[HOST_NODE]; } return node; }
[ "function", "getClosestComponentAncestor", "(", "node", ")", "{", "while", "(", "node", ".", "tNode", ".", "type", "===", "2", "/* View */", ")", "{", "node", "=", "node", ".", "view", "[", "HOST_NODE", "]", ";", "}", "return", "node", ";", "}" ]
If the node is an embedded view, traverses up the view tree to return the closest ancestor view that is attached to a component. If it's already a component node, returns itself.
[ "If", "the", "node", "is", "an", "embedded", "view", "traverses", "up", "the", "view", "tree", "to", "return", "the", "closest", "ancestor", "view", "that", "is", "attached", "to", "a", "component", ".", "If", "it", "s", "already", "a", "component", "node", "returns", "itself", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L24920-L24925
11,794
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getOrCreateInjectable
function getOrCreateInjectable(di, token, flags) { if (flags === void 0) { flags = 0 /* Default */; } var bloomHash = bloomHashBit(token); // If the token has a bloom hash, then it is a directive that is public to the injection system // (diPublic). If there is no hash, fall back to the module injector. if (bloomHash === null) { var moduleInjector = getPreviousOrParentNode().view[INJECTOR$1]; var formerInjector = setCurrentInjector(moduleInjector); try { return inject(token, flags); } finally { setCurrentInjector(formerInjector); } } else { var injector = di; while (injector) { // Get the closest potential matching injector (upwards in the injector tree) that // *potentially* has the token. injector = bloomFindPossibleInjector(injector, bloomHash, flags); // If no injector is found, we *know* that there is no ancestor injector that contains the // token, so we abort. if (!injector) { break; } // At this point, we have an injector which *may* contain the token, so we step through the // directives associated with the injector's corresponding node to get the directive instance. var node = injector.node; var nodeFlags = node.tNode.flags; var count = nodeFlags & 4095 /* DirectiveCountMask */; if (count !== 0) { var start = nodeFlags >> 14 /* DirectiveStartingIndexShift */; var end = start + count; var defs = node.view[TVIEW].directives; for (var i = start; i < end; i++) { // Get the definition for the directive at this index and, if it is injectable (diPublic), // and matches the given token, return the directive instance. var directiveDef = defs[i]; if (directiveDef.type === token && directiveDef.diPublic) { return node.view[DIRECTIVES][i]; } } } // If we *didn't* find the directive for the token and we are searching the current node's // injector, it's possible the directive is on this node and hasn't been created yet. var instance = void 0; if (injector === di && (instance = searchMatchesQueuedForCreation(node, token))) { return instance; } // The def wasn't found anywhere on this node, so it was a false positive. // If flags permit, traverse up the tree and continue searching. if (flags & 2 /* Self */ || flags & 1 /* Host */ && !sameHostView(injector)) { injector = null; } else { injector = injector.parent; } } } // No directive was found for the given token. if (flags & 8 /* Optional */) return null; throw new Error("Injector: NOT_FOUND [" + stringify$1(token) + "]"); }
javascript
function getOrCreateInjectable(di, token, flags) { if (flags === void 0) { flags = 0 /* Default */; } var bloomHash = bloomHashBit(token); // If the token has a bloom hash, then it is a directive that is public to the injection system // (diPublic). If there is no hash, fall back to the module injector. if (bloomHash === null) { var moduleInjector = getPreviousOrParentNode().view[INJECTOR$1]; var formerInjector = setCurrentInjector(moduleInjector); try { return inject(token, flags); } finally { setCurrentInjector(formerInjector); } } else { var injector = di; while (injector) { // Get the closest potential matching injector (upwards in the injector tree) that // *potentially* has the token. injector = bloomFindPossibleInjector(injector, bloomHash, flags); // If no injector is found, we *know* that there is no ancestor injector that contains the // token, so we abort. if (!injector) { break; } // At this point, we have an injector which *may* contain the token, so we step through the // directives associated with the injector's corresponding node to get the directive instance. var node = injector.node; var nodeFlags = node.tNode.flags; var count = nodeFlags & 4095 /* DirectiveCountMask */; if (count !== 0) { var start = nodeFlags >> 14 /* DirectiveStartingIndexShift */; var end = start + count; var defs = node.view[TVIEW].directives; for (var i = start; i < end; i++) { // Get the definition for the directive at this index and, if it is injectable (diPublic), // and matches the given token, return the directive instance. var directiveDef = defs[i]; if (directiveDef.type === token && directiveDef.diPublic) { return node.view[DIRECTIVES][i]; } } } // If we *didn't* find the directive for the token and we are searching the current node's // injector, it's possible the directive is on this node and hasn't been created yet. var instance = void 0; if (injector === di && (instance = searchMatchesQueuedForCreation(node, token))) { return instance; } // The def wasn't found anywhere on this node, so it was a false positive. // If flags permit, traverse up the tree and continue searching. if (flags & 2 /* Self */ || flags & 1 /* Host */ && !sameHostView(injector)) { injector = null; } else { injector = injector.parent; } } } // No directive was found for the given token. if (flags & 8 /* Optional */) return null; throw new Error("Injector: NOT_FOUND [" + stringify$1(token) + "]"); }
[ "function", "getOrCreateInjectable", "(", "di", ",", "token", ",", "flags", ")", "{", "if", "(", "flags", "===", "void", "0", ")", "{", "flags", "=", "0", "/* Default */", ";", "}", "var", "bloomHash", "=", "bloomHashBit", "(", "token", ")", ";", "// If the token has a bloom hash, then it is a directive that is public to the injection system", "// (diPublic). If there is no hash, fall back to the module injector.", "if", "(", "bloomHash", "===", "null", ")", "{", "var", "moduleInjector", "=", "getPreviousOrParentNode", "(", ")", ".", "view", "[", "INJECTOR$1", "]", ";", "var", "formerInjector", "=", "setCurrentInjector", "(", "moduleInjector", ")", ";", "try", "{", "return", "inject", "(", "token", ",", "flags", ")", ";", "}", "finally", "{", "setCurrentInjector", "(", "formerInjector", ")", ";", "}", "}", "else", "{", "var", "injector", "=", "di", ";", "while", "(", "injector", ")", "{", "// Get the closest potential matching injector (upwards in the injector tree) that", "// *potentially* has the token.", "injector", "=", "bloomFindPossibleInjector", "(", "injector", ",", "bloomHash", ",", "flags", ")", ";", "// If no injector is found, we *know* that there is no ancestor injector that contains the", "// token, so we abort.", "if", "(", "!", "injector", ")", "{", "break", ";", "}", "// At this point, we have an injector which *may* contain the token, so we step through the", "// directives associated with the injector's corresponding node to get the directive instance.", "var", "node", "=", "injector", ".", "node", ";", "var", "nodeFlags", "=", "node", ".", "tNode", ".", "flags", ";", "var", "count", "=", "nodeFlags", "&", "4095", "/* DirectiveCountMask */", ";", "if", "(", "count", "!==", "0", ")", "{", "var", "start", "=", "nodeFlags", ">>", "14", "/* DirectiveStartingIndexShift */", ";", "var", "end", "=", "start", "+", "count", ";", "var", "defs", "=", "node", ".", "view", "[", "TVIEW", "]", ".", "directives", ";", "for", "(", "var", "i", "=", "start", ";", "i", "<", "end", ";", "i", "++", ")", "{", "// Get the definition for the directive at this index and, if it is injectable (diPublic),", "// and matches the given token, return the directive instance.", "var", "directiveDef", "=", "defs", "[", "i", "]", ";", "if", "(", "directiveDef", ".", "type", "===", "token", "&&", "directiveDef", ".", "diPublic", ")", "{", "return", "node", ".", "view", "[", "DIRECTIVES", "]", "[", "i", "]", ";", "}", "}", "}", "// If we *didn't* find the directive for the token and we are searching the current node's", "// injector, it's possible the directive is on this node and hasn't been created yet.", "var", "instance", "=", "void", "0", ";", "if", "(", "injector", "===", "di", "&&", "(", "instance", "=", "searchMatchesQueuedForCreation", "(", "node", ",", "token", ")", ")", ")", "{", "return", "instance", ";", "}", "// The def wasn't found anywhere on this node, so it was a false positive.", "// If flags permit, traverse up the tree and continue searching.", "if", "(", "flags", "&", "2", "/* Self */", "||", "flags", "&", "1", "/* Host */", "&&", "!", "sameHostView", "(", "injector", ")", ")", "{", "injector", "=", "null", ";", "}", "else", "{", "injector", "=", "injector", ".", "parent", ";", "}", "}", "}", "// No directive was found for the given token.", "if", "(", "flags", "&", "8", "/* Optional */", ")", "return", "null", ";", "throw", "new", "Error", "(", "\"Injector: NOT_FOUND [\"", "+", "stringify$1", "(", "token", ")", "+", "\"]\"", ")", ";", "}" ]
Searches for an instance of the given directive type up the injector tree and returns that instance if found. Specifically, it gets the bloom filter bit associated with the directive (see bloomHashBit), checks that bit against the bloom filter structure to identify an injector that might have the directive (see bloomFindPossibleInjector), then searches the directives on that injector for a match. If not found, it will propagate up to the next parent injector until the token is found or the top is reached. @param di Node injector where the search should start @param token The directive type to search for @param flags Injection flags (e.g. CheckParent) @returns The instance found
[ "Searches", "for", "an", "instance", "of", "the", "given", "directive", "type", "up", "the", "injector", "tree", "and", "returns", "that", "instance", "if", "found", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L24943-L25007
11,795
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
bloomFindPossibleInjector
function bloomFindPossibleInjector(startInjector, bloomBit, flags) { // Create a mask that targets the specific bit associated with the directive we're looking for. // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding // to bit positions 0 - 31 in a 32 bit integer. var mask = 1 << bloomBit; // Traverse up the injector tree until we find a potential match or until we know there *isn't* a // match. var injector = flags & 4 /* SkipSelf */ ? startInjector.parent : startInjector; while (injector) { // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets: // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc. // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit. var value = void 0; if (bloomBit < 128) { value = bloomBit < 64 ? (bloomBit < 32 ? injector.bf0 : injector.bf1) : (bloomBit < 96 ? injector.bf2 : injector.bf3); } else { value = bloomBit < 192 ? (bloomBit < 160 ? injector.bf4 : injector.bf5) : (bloomBit < 224 ? injector.bf6 : injector.bf7); } // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on, // this injector is a potential match. if ((value & mask) === mask) { return injector; } else if (flags & 2 /* Self */ || flags & 1 /* Host */ && !sameHostView(injector)) { return null; } // If the current injector does not have the directive, check the bloom filters for the ancestor // injectors (cbf0 - cbf7). These filters capture *all* ancestor injectors. if (bloomBit < 128) { value = bloomBit < 64 ? (bloomBit < 32 ? injector.cbf0 : injector.cbf1) : (bloomBit < 96 ? injector.cbf2 : injector.cbf3); } else { value = bloomBit < 192 ? (bloomBit < 160 ? injector.cbf4 : injector.cbf5) : (bloomBit < 224 ? injector.cbf6 : injector.cbf7); } // If the ancestor bloom filter value has the bit corresponding to the directive, traverse up to // find the specific injector. If the ancestor bloom filter does not have the bit, we can abort. injector = (value & mask) ? injector.parent : null; } return null; }
javascript
function bloomFindPossibleInjector(startInjector, bloomBit, flags) { // Create a mask that targets the specific bit associated with the directive we're looking for. // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding // to bit positions 0 - 31 in a 32 bit integer. var mask = 1 << bloomBit; // Traverse up the injector tree until we find a potential match or until we know there *isn't* a // match. var injector = flags & 4 /* SkipSelf */ ? startInjector.parent : startInjector; while (injector) { // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets: // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc. // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit. var value = void 0; if (bloomBit < 128) { value = bloomBit < 64 ? (bloomBit < 32 ? injector.bf0 : injector.bf1) : (bloomBit < 96 ? injector.bf2 : injector.bf3); } else { value = bloomBit < 192 ? (bloomBit < 160 ? injector.bf4 : injector.bf5) : (bloomBit < 224 ? injector.bf6 : injector.bf7); } // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on, // this injector is a potential match. if ((value & mask) === mask) { return injector; } else if (flags & 2 /* Self */ || flags & 1 /* Host */ && !sameHostView(injector)) { return null; } // If the current injector does not have the directive, check the bloom filters for the ancestor // injectors (cbf0 - cbf7). These filters capture *all* ancestor injectors. if (bloomBit < 128) { value = bloomBit < 64 ? (bloomBit < 32 ? injector.cbf0 : injector.cbf1) : (bloomBit < 96 ? injector.cbf2 : injector.cbf3); } else { value = bloomBit < 192 ? (bloomBit < 160 ? injector.cbf4 : injector.cbf5) : (bloomBit < 224 ? injector.cbf6 : injector.cbf7); } // If the ancestor bloom filter value has the bit corresponding to the directive, traverse up to // find the specific injector. If the ancestor bloom filter does not have the bit, we can abort. injector = (value & mask) ? injector.parent : null; } return null; }
[ "function", "bloomFindPossibleInjector", "(", "startInjector", ",", "bloomBit", ",", "flags", ")", "{", "// Create a mask that targets the specific bit associated with the directive we're looking for.", "// JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding", "// to bit positions 0 - 31 in a 32 bit integer.", "var", "mask", "=", "1", "<<", "bloomBit", ";", "// Traverse up the injector tree until we find a potential match or until we know there *isn't* a", "// match.", "var", "injector", "=", "flags", "&", "4", "/* SkipSelf */", "?", "startInjector", ".", "parent", ":", "startInjector", ";", "while", "(", "injector", ")", "{", "// Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:", "// bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.", "// Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.", "var", "value", "=", "void", "0", ";", "if", "(", "bloomBit", "<", "128", ")", "{", "value", "=", "bloomBit", "<", "64", "?", "(", "bloomBit", "<", "32", "?", "injector", ".", "bf0", ":", "injector", ".", "bf1", ")", ":", "(", "bloomBit", "<", "96", "?", "injector", ".", "bf2", ":", "injector", ".", "bf3", ")", ";", "}", "else", "{", "value", "=", "bloomBit", "<", "192", "?", "(", "bloomBit", "<", "160", "?", "injector", ".", "bf4", ":", "injector", ".", "bf5", ")", ":", "(", "bloomBit", "<", "224", "?", "injector", ".", "bf6", ":", "injector", ".", "bf7", ")", ";", "}", "// If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,", "// this injector is a potential match.", "if", "(", "(", "value", "&", "mask", ")", "===", "mask", ")", "{", "return", "injector", ";", "}", "else", "if", "(", "flags", "&", "2", "/* Self */", "||", "flags", "&", "1", "/* Host */", "&&", "!", "sameHostView", "(", "injector", ")", ")", "{", "return", "null", ";", "}", "// If the current injector does not have the directive, check the bloom filters for the ancestor", "// injectors (cbf0 - cbf7). These filters capture *all* ancestor injectors.", "if", "(", "bloomBit", "<", "128", ")", "{", "value", "=", "bloomBit", "<", "64", "?", "(", "bloomBit", "<", "32", "?", "injector", ".", "cbf0", ":", "injector", ".", "cbf1", ")", ":", "(", "bloomBit", "<", "96", "?", "injector", ".", "cbf2", ":", "injector", ".", "cbf3", ")", ";", "}", "else", "{", "value", "=", "bloomBit", "<", "192", "?", "(", "bloomBit", "<", "160", "?", "injector", ".", "cbf4", ":", "injector", ".", "cbf5", ")", ":", "(", "bloomBit", "<", "224", "?", "injector", ".", "cbf6", ":", "injector", ".", "cbf7", ")", ";", "}", "// If the ancestor bloom filter value has the bit corresponding to the directive, traverse up to", "// find the specific injector. If the ancestor bloom filter does not have the bit, we can abort.", "injector", "=", "(", "value", "&", "mask", ")", "?", "injector", ".", "parent", ":", "null", ";", "}", "return", "null", ";", "}" ]
Finds the closest injector that might have a certain directive. Each directive corresponds to a bit in an injector's bloom filter. Given the bloom bit to check and a starting injector, this function traverses up injectors until it finds an injector that contains a 1 for that bit in its bloom filter. A 1 indicates that the injector may have that directive. It only *may* have the directive because directives begin to share bloom filter bits after the BLOOM_SIZE is reached, and it could correspond to a different directive sharing the bit. Note: We can skip checking further injectors up the tree if an injector's cbf structure has a 0 for that bloom bit. Since cbf contains the merged value of all the parent injectors, a 0 in the bloom bit indicates that the parents definitely do not contain the directive and do not need to be checked. @param injector The starting node injector to check @param bloomBit The bit to check in each injector's bloom filter @param flags The injection flags for this injection site (e.g. Optional or SkipSelf) @returns An injector that might have the directive
[ "Finds", "the", "closest", "injector", "that", "might", "have", "a", "certain", "directive", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L25056-L25100
11,796
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
sameHostView
function sameHostView(injector) { return !!injector.parent && injector.parent.node.view === injector.node.view; }
javascript
function sameHostView(injector) { return !!injector.parent && injector.parent.node.view === injector.node.view; }
[ "function", "sameHostView", "(", "injector", ")", "{", "return", "!", "!", "injector", ".", "parent", "&&", "injector", ".", "parent", ".", "node", ".", "view", "===", "injector", ".", "node", ".", "view", ";", "}" ]
Checks whether the current injector and its parent are in the same host view. This is necessary to support @Host() decorators. If @Host() is set, we should stop searching once the injector and its parent view don't match because it means we'd cross the view boundary.
[ "Checks", "whether", "the", "current", "injector", "and", "its", "parent", "are", "in", "the", "same", "host", "view", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L25107-L25109
11,797
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getOrCreateElementRef
function getOrCreateElementRef(di) { return di.elementRef || (di.elementRef = new ElementRef$1(di.node.native)); }
javascript
function getOrCreateElementRef(di) { return di.elementRef || (di.elementRef = new ElementRef$1(di.node.native)); }
[ "function", "getOrCreateElementRef", "(", "di", ")", "{", "return", "di", ".", "elementRef", "||", "(", "di", ".", "elementRef", "=", "new", "ElementRef$1", "(", "di", ".", "node", ".", "native", ")", ")", ";", "}" ]
Creates an ElementRef for a given node injector and stores it on the injector. Or, if the ElementRef already exists, retrieves the existing ElementRef. @param di The node injector where we should store a created ElementRef @returns The ElementRef instance to use
[ "Creates", "an", "ElementRef", "for", "a", "given", "node", "injector", "and", "stores", "it", "on", "the", "injector", ".", "Or", "if", "the", "ElementRef", "already", "exists", "retrieves", "the", "existing", "ElementRef", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L25123-L25125
11,798
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getOrCreateContainerRef
function getOrCreateContainerRef(di) { if (!di.viewContainerRef) { var vcRefHost = di.node; ngDevMode && assertNodeOfPossibleTypes(vcRefHost, 0 /* Container */, 3 /* Element */); var hostParent = getParentLNode(vcRefHost); var lContainer = createLContainer(hostParent, vcRefHost.view, true); var comment = vcRefHost.view[RENDERER].createComment(ngDevMode ? 'container' : ''); var lContainerNode = createLNodeObject(0 /* Container */, vcRefHost.view, hostParent, comment, lContainer, null); appendChild(hostParent, comment, vcRefHost.view); if (vcRefHost.queries) { lContainerNode.queries = vcRefHost.queries.container(); } var hostTNode = vcRefHost.tNode; if (!hostTNode.dynamicContainerNode) { hostTNode.dynamicContainerNode = createTNode(0 /* Container */, -1, null, null, hostTNode, null); } lContainerNode.tNode = hostTNode.dynamicContainerNode; vcRefHost.dynamicLContainerNode = lContainerNode; addToViewTree(vcRefHost.view, hostTNode.index, lContainer); di.viewContainerRef = new ViewContainerRef$1(lContainerNode); } return di.viewContainerRef; }
javascript
function getOrCreateContainerRef(di) { if (!di.viewContainerRef) { var vcRefHost = di.node; ngDevMode && assertNodeOfPossibleTypes(vcRefHost, 0 /* Container */, 3 /* Element */); var hostParent = getParentLNode(vcRefHost); var lContainer = createLContainer(hostParent, vcRefHost.view, true); var comment = vcRefHost.view[RENDERER].createComment(ngDevMode ? 'container' : ''); var lContainerNode = createLNodeObject(0 /* Container */, vcRefHost.view, hostParent, comment, lContainer, null); appendChild(hostParent, comment, vcRefHost.view); if (vcRefHost.queries) { lContainerNode.queries = vcRefHost.queries.container(); } var hostTNode = vcRefHost.tNode; if (!hostTNode.dynamicContainerNode) { hostTNode.dynamicContainerNode = createTNode(0 /* Container */, -1, null, null, hostTNode, null); } lContainerNode.tNode = hostTNode.dynamicContainerNode; vcRefHost.dynamicLContainerNode = lContainerNode; addToViewTree(vcRefHost.view, hostTNode.index, lContainer); di.viewContainerRef = new ViewContainerRef$1(lContainerNode); } return di.viewContainerRef; }
[ "function", "getOrCreateContainerRef", "(", "di", ")", "{", "if", "(", "!", "di", ".", "viewContainerRef", ")", "{", "var", "vcRefHost", "=", "di", ".", "node", ";", "ngDevMode", "&&", "assertNodeOfPossibleTypes", "(", "vcRefHost", ",", "0", "/* Container */", ",", "3", "/* Element */", ")", ";", "var", "hostParent", "=", "getParentLNode", "(", "vcRefHost", ")", ";", "var", "lContainer", "=", "createLContainer", "(", "hostParent", ",", "vcRefHost", ".", "view", ",", "true", ")", ";", "var", "comment", "=", "vcRefHost", ".", "view", "[", "RENDERER", "]", ".", "createComment", "(", "ngDevMode", "?", "'container'", ":", "''", ")", ";", "var", "lContainerNode", "=", "createLNodeObject", "(", "0", "/* Container */", ",", "vcRefHost", ".", "view", ",", "hostParent", ",", "comment", ",", "lContainer", ",", "null", ")", ";", "appendChild", "(", "hostParent", ",", "comment", ",", "vcRefHost", ".", "view", ")", ";", "if", "(", "vcRefHost", ".", "queries", ")", "{", "lContainerNode", ".", "queries", "=", "vcRefHost", ".", "queries", ".", "container", "(", ")", ";", "}", "var", "hostTNode", "=", "vcRefHost", ".", "tNode", ";", "if", "(", "!", "hostTNode", ".", "dynamicContainerNode", ")", "{", "hostTNode", ".", "dynamicContainerNode", "=", "createTNode", "(", "0", "/* Container */", ",", "-", "1", ",", "null", ",", "null", ",", "hostTNode", ",", "null", ")", ";", "}", "lContainerNode", ".", "tNode", "=", "hostTNode", ".", "dynamicContainerNode", ";", "vcRefHost", ".", "dynamicLContainerNode", "=", "lContainerNode", ";", "addToViewTree", "(", "vcRefHost", ".", "view", ",", "hostTNode", ".", "index", ",", "lContainer", ")", ";", "di", ".", "viewContainerRef", "=", "new", "ViewContainerRef$1", "(", "lContainerNode", ")", ";", "}", "return", "di", ".", "viewContainerRef", ";", "}" ]
Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef already exists, retrieves the existing ViewContainerRef. @returns The ViewContainerRef instance to use
[ "Creates", "a", "ViewContainerRef", "and", "stores", "it", "on", "the", "injector", ".", "Or", "if", "the", "ViewContainerRef", "already", "exists", "retrieves", "the", "existing", "ViewContainerRef", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L25139-L25162
11,799
CuppaLabs/angular2-multiselect-dropdown
docs/vendor.js
getOrCreateTemplateRef
function getOrCreateTemplateRef(di) { if (!di.templateRef) { ngDevMode && assertNodeType(di.node, 0 /* Container */); var hostNode = di.node; var hostTNode = hostNode.tNode; ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated'); di.templateRef = new TemplateRef$1(getOrCreateElementRef(di), hostTNode.tViews, getRenderer(), hostNode.data[QUERIES]); } return di.templateRef; }
javascript
function getOrCreateTemplateRef(di) { if (!di.templateRef) { ngDevMode && assertNodeType(di.node, 0 /* Container */); var hostNode = di.node; var hostTNode = hostNode.tNode; ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated'); di.templateRef = new TemplateRef$1(getOrCreateElementRef(di), hostTNode.tViews, getRenderer(), hostNode.data[QUERIES]); } return di.templateRef; }
[ "function", "getOrCreateTemplateRef", "(", "di", ")", "{", "if", "(", "!", "di", ".", "templateRef", ")", "{", "ngDevMode", "&&", "assertNodeType", "(", "di", ".", "node", ",", "0", "/* Container */", ")", ";", "var", "hostNode", "=", "di", ".", "node", ";", "var", "hostTNode", "=", "hostNode", ".", "tNode", ";", "ngDevMode", "&&", "assertDefined", "(", "hostTNode", ".", "tViews", ",", "'TView must be allocated'", ")", ";", "di", ".", "templateRef", "=", "new", "TemplateRef$1", "(", "getOrCreateElementRef", "(", "di", ")", ",", "hostTNode", ".", "tViews", ",", "getRenderer", "(", ")", ",", "hostNode", ".", "data", "[", "QUERIES", "]", ")", ";", "}", "return", "di", ".", "templateRef", ";", "}" ]
Creates a TemplateRef and stores it on the injector. Or, if the TemplateRef already exists, retrieves the existing TemplateRef. @param di The node injector where we should store a created TemplateRef @returns The TemplateRef instance to use
[ "Creates", "a", "TemplateRef", "and", "stores", "it", "on", "the", "injector", ".", "Or", "if", "the", "TemplateRef", "already", "exists", "retrieves", "the", "existing", "TemplateRef", "." ]
cb94eb9af46de79c69d61b4fd37a800009fb70d3
https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L25258-L25267