Skip to content

Commit 34280f9

Browse files
asgerferik-krogh
andauthored
Update QLDoc for getATemplateArgument
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
1 parent deca7f3 commit 34280f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

javascript/ql/src/semmle/javascript/frameworks/Angular2.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,13 @@ module Angular2 {
356356
/** Gets an HTML element that instantiates this component. */
357357
HTML::Element getATemplateInstantiation() { result.getName() = getSelector() }
358358

359-
/** Gets an argument that flows into the `name` field of this component. */
359+
/**
360+
* Gets an argument that flows into the `name` field of this component.
361+
*
362+
* For example, if the selector for this component is `"my-class"`, then this
363+
* predicate can match an attribute like: `<my-class [foo]="1+2"/>`.
364+
* The result of this predicate would be the `1+2` expression, and `name` would be `"foo"`.
365+
*/
360366
DataFlow::Node getATemplateArgument(string name) {
361367
result =
362368
getAttributeValueAsNode(getATemplateInstantiation().getAttributeByName("[" + name + "]"))

0 commit comments

Comments
 (0)