0

I want too display Content in a pop up box . The information already comes too html. using ng-repeat="x in titles"

Question So how do I pass content too my controller.js so it can be displayed in the popup box ? NB: I was too pass the x.excerpt too ng-click="showAlert()" so it can be displayed in the popupbox.

HTML

<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');
   });
 };

1 Answer 1

0

2 way Data-Binding

Thanks, Solved it using the following way:

Try

 <input type='text' ng-model="profileedit_name">
 <button ng-click="doSaveProfileEdit(profileedit_name)" >Save</button>

with

$scope.doSaveProfileEdit = function(newName) {
  alert(newName);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.