Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

tbosch
Copy link
Contributor

@tbosch tbosch commented Apr 26, 2016

Does not need to go into G3...

@tbosch tbosch force-pushed the vars_refs branch 2 times, most recently from 72db404 to 90b13dc Compare April 26, 2016 23:27
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,
Copy link
Contributor Author

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,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used, remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@tbosch tbosch added pr_state: LGTM action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Apr 27, 2016
@tbosch
Copy link
Contributor Author

tbosch commented Apr 27, 2016

Reviewd in person with @mhevery

@tbosch tbosch force-pushed the vars_refs branch 2 times, most recently from 41c9b14 to e1eda7d Compare April 27, 2016 18:31
}

/**
* A variable declaration on a <template> (e.g. `let var="expression"`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let var --> let-var ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, yes.

@tbosch tbosch force-pushed the vars_refs branch 2 times, most recently from 494a565 to c1a4f20 Compare April 27, 2016 21:14
@@ -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>
Copy link
Member

@gkalpak gkalpak Apr 27, 2016

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
@tbosch tbosch added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Apr 28, 2016
@mary-poppins
Copy link

Merging PR #8264 on behalf of @hansl to branch presubmit-hansl-pr-8264.

@mhevery mhevery closed this in d2efac1 Apr 28, 2016
@tbosch tbosch deleted the vars_refs branch April 29, 2016 08:22
tbosch added a commit to tbosch/angular that referenced this pull request Jun 7, 2016
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
tbosch added a commit to tbosch/angular that referenced this pull request Jun 15, 2016
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
tbosch added a commit to tbosch/angular that referenced this pull request Jun 24, 2016
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
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants