X Tutup
Skip to content

Component not completely recreated when using canReuse #5500

@thelgevold

Description

@thelgevold

I might be misunderstanding the purpose of canReuse, but I am noticing that my component is not recreated from scratch when navigating back to it by route. The radio button retains its value when returning. It was my impression that canReuse with a return value of false would recreate the entire component - DOM and all....?

Template
<input #male name="gender" type="radio" value="Male" (click)="gender = male.value" />

TypeScript
canReuse(next: ComponentInstruction, prev: ComponentInstruction) { return false; }

Code:https://github.com/thelgevold/angular-2-samples/blob/master/demo-page.ts
Demo: http://www.syntaxsuccess.com/angular-2-samples/#/demo/input

Steps to reproduce

  1. Select a gender
  2. Navigate away to a different component
  3. Navigate back and observe that the selected gender from step 1) is retained despite canReuse returning false

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup