How to use the Polymer <content> tag in a dart?

I am trying to use a content tag in a dart polymer. The Polymer-Element is displayed correctly, but the content is not displayed at all.

This is my code:

<polymer-element name="modal-dialog" >
  <link rel="stylesheet" href="packages/bootjack/css/bootstrap.css">

  <template>

    <button on-click="{{show}}">jo</button>
    <div id="modal" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times</button>
            <h3 style="margin: 0">Bootjack</h3>
          </div>
          <div class="modal-body">
            <content></content>
          </div>
          <div class="modal-footer" style="margin: 0">
            <button class="btn btn-success" data-dismiss="modal" id="ok">OK</button>
          </div>
        </div>
      </div>
    </div>
  </template>
<script type="application/dart">
import 'package:polymer/polymer.dart';
import 'package:bootjack/bootjack.dart';
import 'dart:html';

@CustomTag('modal-dialog')
class ModalDialog extends PolymerElement {

  Modal modal;

  ModalDialog.created() : super.created(){
    Modal.use();
    Transition.use();
    modal = Modal.wire(this.shadowRoot.querySelector("#modal"));

  }  
  void show(){
    modal.show();
  }
}
</script>     
</polymer-element>

Then I create an instance in index.html:

<modal-dialog>This should be in the content-tag</modal-dialog>

I use:
Dart Editor version 1.2.0.release (STABLE)
Dart SDK version 1.2.0
OS X 10.8.5

Thanks for any tips :)

+4
source share
1 answer

I tried my code. I removed the CSS link and the content was showing in the right place.

, , CSS, ,

CSS

<style>
  * {
    display: block;
    border: solid 3px red;
  }
</style>

, CSS . , CSS.

+1

Source: https://habr.com/ru/post/1529242/


All Articles