Polymer のペーパー ダイアログは Angular2 Dart で使用できますか? 私が見つけることができた唯一の議論は、ここでの質問でした。
コードをAngularコンポーネントに組み込んでみました。$['dialogArtist']
ダイアログを開くのが好きではありませんでした。次に、新しいクラスを作成します
class ArtistDialog extends PolymerElement {...
そこで$['dialogArtist]
働いた。次に、フォームデータに問題がありました。ダイアログではなく、コンポーネントでそれを探し続けました。ダイアログ html はコンポーネント html と同じファイルにあるため、何らかの関係がある可能性があります。フォームをコメントアウトしたとき。ダイアログクラスの初期化子が見つからないという苦情がありました。Angular2 Dart コンポーネントから Polymer ペーパー ダイアログを開く例はありますか?
私が知る必要があるのは、ダイアログを開いてそこからデータを取得するためにコンポーネントに入れる必要があることだけだと思います。上記のリンクの例は、ダイアログ クラスに適していると思います。また、ダイアログのhtmlはどこに行きますか?
私の角度コンポーネントの関連部分:
@Component(selector: 'my-artists',
templateUrl: 'artists_component.html',
//encapsulation: ViewEncapsulation.Native, // added for polymer
styleUrls: const['artist.css']
)
class ArtistsComponent implements OnInit {
...
ArtistDialog editDialog;
void ngOnInit() {
getArtists();
editDialog = new ArtistDialog.created();
}
void onEditArtist() {
editArtist = selectedArtist;
editDialog.open;
}
私のポリマー成分:
//@CustomTag('dialogArtist'); //uncomment this cause and error
class ArtistDialog extends PolymerElement {
String birth_year;
ArtistDialog.created() : super.created();
//@observable int selected = 0; // uncommenting this causes and error
void open() {
$['dialogArtist'] as PaperDialog..open();
}
}
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 rel="import" href="packages/polymer_elements/paper_header_panel.html">
<link rel="import" href="packages/polymer_elements/paper_toolbar.html">
<link rel="import" href="packages/polymer_elements/paper_menu.html">
<link rel="import" href="packages/polymer_elements/paper_item.html">
<link rel="import" href="packages/polymer_elements/paper_menu_button.html">
<link rel="import" href="packages/polymer_elements/paper_input.html">
<link rel="import" href="packages/polymer_elements/paper_dialog.html">
<link rel="import" href="packages/polymer_elements/iron_list.html">
<link href="master.css" rel="stylesheet" type="text/css" />
<style is="custom-style">
これは、ダイアログ ボックスの私の html です。コンポーネントhtmlと同じファイルにあります。
<polymer-element name="dialogArtist">
<paper-dialog id="dialog">
<p>This is a dialog.</p>
</paper-dialog>
</polymer-element>