New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): separate refs from vars. #8264
Conversation
72db404
to
90b13dc
Compare
var identifier = bindParts[5]; | ||
this._parseVariable(identifier, attrValue, attr.sourceSpan, targetVars); | ||
} else if (isPresent(bindParts[2])) { // match: var-name / var-name="iden" | ||
this._reportError(`"var-" is deprecated. Use "ref-" or "let-" instead!`, attr.sourceSpan, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Report the exact replacement, as we know it by checking the isTemplateElement
flag
@@ -30,7 +30,7 @@ import { | |||
NgContentAst, | |||
EmbeddedTemplateAst, | |||
ElementAst, | |||
VariableAst, | |||
ReferenceAst, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used, remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Reviewd in person with @mhevery |
41c9b14
to
e1eda7d
Compare
} | ||
|
||
/** | ||
* A variable declaration on a <template> (e.g. `let var="expression"`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let var --> let-var ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, yes.
494a565
to
c1a4f20
Compare
@@ -70,7 +70,7 @@ export abstract class ChangeDetectorRef { | |||
* @Component({ | |||
* selector: 'giant-list', | |||
* template: ` | |||
* <li *ngFor="#d of dataProvider.data">Data {{d}}</lig> | |||
* <li *ngFor="let d of dataProvider.data">Data {{d}}</lig> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</lig>
--> </li>
Introduces `ref-` to give a name to an element or a directive (also works for `<template>` elements), and `let-` to introduce an input variable for a `<template>` element. BREAKING CHANGE: - `#...` now always means `ref-`. - `<template #abc>` now defines a reference to the TemplateRef, instead of an input variable used inside of the template. - `#...` inside of a *ngIf, … directives is deprecated. Use `let …` instead. - `var-...` is deprecated. Replace with `let-...` for `<template>` elements and `ref-` for non `<template>` elements. Closes angular#7158
Merging PR #8264 on behalf of @hansl to branch presubmit-hansl-pr-8264. |
Introduces `ref-` to give a name to an element or a directive (also works for `<template>` elements), and `let-` to introduce an input variable for a `<template>` element. BREAKING CHANGE: - `#...` now always means `ref-`. - `<template #abc>` now defines a reference to the TemplateRef, instead of an input variable used inside of the template. - `#...` inside of a *ngIf, … directives is deprecated. Use `let …` instead. - `var-...` is deprecated. Replace with `let-...` for `<template>` elements and `ref-` for non `<template>` elements. Closes angular#7158 Closes angular#8264
Introduces `ref-` to give a name to an element or a directive (also works for `<template>` elements), and `let-` to introduce an input variable for a `<template>` element. BREAKING CHANGE: - `#...` now always means `ref-`. - `<template #abc>` now defines a reference to the TemplateRef, instead of an input variable used inside of the template. - `#...` inside of a *ngIf, … directives is deprecated. Use `let …` instead. - `var-...` is deprecated. Replace with `let-...` for `<template>` elements and `ref-` for non `<template>` elements. Closes angular#7158 Closes angular#8264
Introduces `ref-` to give a name to an element or a directive (also works for `<template>` elements), and `let-` to introduce an input variable for a `<template>` element. BREAKING CHANGE: - `#...` now always means `ref-`. - `<template #abc>` now defines a reference to the TemplateRef, instead of an input variable used inside of the template. - `#...` inside of a *ngIf, … directives is deprecated. Use `let …` instead. - `var-...` is deprecated. Replace with `let-...` for `<template>` elements and `ref-` for non `<template>` elements. Closes angular#7158 Closes angular#8264
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Does not need to go into G3...