我也想在弹出框中显示内容。这些信息已经提供给html了。使用ng-repeat="x in titles"
问题,那么我如何传递内容,我的controller.js,以便它可以显示在弹出框中?注意:我太传递x.excerpt太ng-click="showAlert()"了,所以它可以显示在弹出框中。
<ul>
<li ng-repeat="x in titles">
<br />
<hr />
<h3> {{ x.title }} </h3>
<p>{{x.date | date : format : 'MM-dd-yyyy'}}</p>
<img src="{{x.featured_image.attachment_meta.sizes.medium.url}}" width="100%" >
<span >
<p>{{x.excerpt}}</p>
<button class="button button-small button-assertive" ng-click="showAlert()">
Click here too display Content
</button>
</span>
</li>
</ul>Controller.js
// An alert dialog
$scope.showAlert = function() {
var alertPopup = $ionicPopup.alert({
title: 'Don\'t eat that!',
template: 'This is where I want the content too be.'
});
alertPopup.then(function(res) {
console.log('Thank you for not eating my delicious ice cream cone');
});
};发布于 2015-01-22 08:40:10
双向数据绑定
谢谢,用以下方式解决了这个问题:
试一试
<input type='text' ng-model="profileedit_name">
<button ng-click="doSaveProfileEdit(profileedit_name)" >Save</button>使用
$scope.doSaveProfileEdit = function(newName) {
alert(newName);
}https://stackoverflow.com/questions/28083620
复制相似问题