は私のモーダルです:
例ルータが行動に落ちている
<div class="reveal" id="deleteLocationModal" data-reveal>
<div class="row">
<div class="columns">
Are you sure you want to delete this location?
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="columns">
<button id="cancelButton" class="secondary button" data-close type="button">Cancel</button>
<button id="deleteButton" class="button" {{action "deleteLocation" model}} data-close type="button">Delete</button>
</div>
</div>
</div>
はハッシュ:
actions: {
deleteLocation(model) {
Ember.assert("Params must be provided", model);
model.save().then((/* response */) => {
this.transitionTo('locations'); //locations is my index page.
//flash message to inform the user of success.
});
}, (error) => {
//handle error.
// display flash message
// rollback any dirty attributes
});
}
をIこれが役に立ったら、
Jeff
emberのすべてのサブルートと同じ方法です。開かれたモーダルのためのサブルーチンのためのテンプレートを保持します。閉じるときには、インデックスルート –
に移動するだけです*ウェブ上のモーダル*は通常、あなたのページに灰色の透明な背景がぶら下がっている大きな固定サイズのdivを持つことを意味します。 – Lux
私が望むものの例として、このボード(https://trello.com/b/ezWgKsol/sales-enterprise-feature-requests-sample)を参照してください。 –