Flex Mixin polymer iron does not work, but classes do

I got Polymer iron-flex-layout for working in my AngularDart component using classes. Since it generates an obsolescence warning, I thought I would try an alternative alternative: mixin's. They do not work.

I currently have this import in my artist_component.dart file:

import 'package:polymer_elements/iron_flex_layout.dart';

I also tried adding this to my index.html

    <link rel="import" href="packages/polymer_elements/iron_flex_layout.html">

This is different from the example in the documentation that uses the gazebo. In my artist_component.html, I have:

<style is="custom-style">
  .container {
   @apply(--layout-horizontal);
  }
  .flexchild {
    @apply(--layout-flex-3);
  }
  .flexchild-2 {
    @apply(--layout-flex-9);
  }
</style>
<section class="container">
  <section class="flexchild gutter">
...

I tried putting import in index.html and in my main css file along with no affect style. Given that classes work, you think mixim will be there too.

+4
1

, . , . pubspec :

polymer: ^1.0.0-rc.17
polymer_elements: ^1.0.0-rc.8

, , index.html:

<link rel="import" href="packages/polymer/polymer.html">

, , , , , . index.html:

<!DOCTYPE html>
<html>
<head>
<title>Jazz Cat</title>
<script>
  window.Polymer = window.Polymer || {};
  window.Polymer.dom = 'shadow';
</script>

<!-- For testing using pub serve directly use: -->
<base href="/">
<!-- For testing in WebStorm use: -->
<!-- <base href="/dart/web/"> -->

<link rel="import" href="packages/polymer/polymer.html">
<link rel="import" href="packages/polymer_elements/iron_flex_layout.html">
<link href="master.css" rel="stylesheet" type="text/css" />
<style is="custom-style">
  .container {
    @apply(--layout-horizontal);
  }
  .element-index {
    @apply(--layout-flex-3);
  }
  .element-body {
    @apply(--layout-flex-9);
  }
  .element-main {
    @apply(--layout-flex-7);
  }
  .element-sidebar {
    @apply(--layout-flex-2);
  }
</style>
<script defer src="main.dart" type="application/dart"></script>
<script defer src="packages/browser/dart.js"></script>
</head>
<my-app>Loading...</my-app>
</html>

, , . , mixin:

<section class="container">
<section class="element-index">
<h1>{{title}}</h1>
  <paper-listbox class="scroll-list" (click)="onScroll()">
    <paper-item class="item-height" *ngFor="let artist of artists" [class.selected]="artist == selectedArtist" (click)="onSelect(artist)">
      {{artist.first_name}} {{artist.last_name}}
    </paper-item>
  </paper-listbox>
<paper-button (click)="gotoDetail()">Detail</paper-button>
<!--<paper-icon-button icon="refresh" (click)="gotoDetail()"></paper-icon-button>-->
  <!--<button (click)="gotoDetail()">View Details</button>-->
</section>
<section class="element-body">
<div *ngIf="selectedArtist != null">
  <h2>{{selectedArtist.first_name}} {{selectedArtist.last_name}}</h2>
  <!--<section class="layout horizontal">-->
  <section class="container">
    <section class="element-main">
      <!--<dl class="justified">
        <dt>Instrument:</dt><dd>{{ selectedArtist.primary_instrument }} </dd>
        <dt>Other:</dt><dd>{{ selectedArtist.other_instruments }}</dd>
        <dt>Birth:</dt><dd>{{ selectedArtist.birth_year }}</dd>
        <dt>Death:</dt><dd>{{ selectedArtist.death_year }}</dd>
      </dl>-->
      <h3>Notes</h3>
      <p>{{ selectedArtist.notes }}</p>
      <h3>Recordings</h3>
      <table class="index">
        <th>Date</th>
        <th>Title</th>
        <th>Leader</th>
        <tr *ngFor="let credit of artist_credits" >
          <td class="tableDate">{{ credit.recording_date | date:'d MMM yyyy' }}</td>
          <td>{{ credit.title }}</td>
          <td>{{ credit.first_name }} {{ credit.last_name}}</td>
        </tr>
      </table>
    </section>
    <section class="element-sidebar">
      <dl class="narrow-list">
        <dt>Instrument</dt><dd>{{ selectedArtist.primary_instrument }} </dd>
        <dt>Other</dt><dd>{{ selectedArtist.other_instruments }}</dd>
        <dt>Birth</dt><dd>{{ selectedArtist.birth_year }}</dd>
        <dt>Death</dt><dd>{{ selectedArtist.death_year }}</dd>
      </dl>
    </section>
  </section>
</div>
</section>
</section>

, 1.1, .

+1

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


All Articles