fix(ivy): compiler should generate restoreView() for local refs in listeners (#27034)

PR Close #27034
This commit is contained in:
Kara Erickson
2018-11-09 15:07:50 -08:00
committed by Andrew Kushnir
parent 97ef8ae9e7
commit 1810cdf2c3
4 changed files with 112 additions and 48 deletions

View File

@ -206,8 +206,10 @@ describe('compiler compliance: listen()', () => {
vars: 0,
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
const $s$ = $r3$.ɵgetCurrentView();
$r3$.ɵelementStart(0, "button", $e0_attrs$);
$r3$.ɵlistener("click", function MyComponent_Template_button_click_listener($event) {
$r3$.ɵrestoreView($s$);
const $user$ = $r3$.ɵreference(3);
return ctx.onClick($user$.value);
});