0
Angular変数をNotify.js関数に渡す方法はありますか? 関数内の$ .notify()でAngularのスコープ内で関数を作成しようとしましたが、実行されません。関数をプレーンJS関数としてアプリケーションの範囲外に移動すると、うまく動作しますが、Angularに格納されたデータを使用することはできません。
私が持っている:
function showAchievement() {
$.notify({
title: '{{angularData}}',
message: '{{moreData}}.'
}, {
type: 'achievement',
placement: {
align: "left"
},
animate:{
enter:'animated fadeInLeft',
exit:'animated fadeOutRight'
},
delay: 5000
});
}
と私のCSS:
.alert-achievement {
background: url("../img/purple-bg.png") no-repeat;
border: 4px solid purple;
color: dodgerblue;
padding: 10px;
width: 25%;
}
.alert-achievement > [data-notify="title"] {
color: purple;
text-align: center;
display: block;
font-weight: bold;
margin-bottom: 5px;
}
.alert-achievement > [data-notify="message"] {
font-size: 80%;
}
それは角度のうまく外に動作します。 Angularの内部でさえも起動されます。 Angular $ scope.titleの内容に基づいてタイトルとメッセージを渡すだけです。機能上の
ありがとうございます!私は実際にそれを試みましたが、angularDataの前に$ scopeを追加するのを忘れていました。 IDEはそれを認識しましたが、機能しませんでした。おっとっと。 – Thranor