How can i make custom Polymer element hidden?

Viewed 8145

For experiments I use the custom element tute-stopwatch from https://www.dartlang.org/docs/tutorials/polymer-intro/

When I set the attribute '.hidden = true' for buttons, these buttons hide successfully, but the element tute-stopwatch doesn't.

  void addChild(Event e, var detail, Node target) {
    ..
    stopButton.hidden = true;
    startButton.hidden = true;
    resetButton.hidden = true;

    this.hidden = true; 
}

When i use subtemplate in tute_stop_watch.html:

<template if="{{ visible }}" id="innerTemplate">

and in tute_stop_watch.dart:

  void enteredView() {
    super.enteredView();
    startButton = $['startButton']; // $['startButton'] == null
    innerTemplate =$['innerTemplate'] // find correct, but innerTemplate.childNodes == []

I try make element with all abilities tute-stopwatch visible on demand.

2 Answers
Related