Hi all,

i think i need your help for the following problem.

I just want to load some data-binding input fields with an ajax-request and 
bind some data in the input fields. 

Here is my code:

<html>
<head>
<script 
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js";></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/
angular.min.js"></script>

<script>
$(document).ready(function(){
    $("button").click(function(){
        $.ajax({url: "http://localhost/request.html";, success: 
function(result){
            $("#div1").html(result);
        }});
    });
});
</script>

</head>
<body>
  <div id="div1"><h2>Input Data:</h2></div>

  <button>Get External Content</button>
</body>
</html>


// request.html - Code with the AJAX Request

<div ng-app>
 <label>Name:</label>
 <input type="text" ng-model="yourName" placeholder="Enter a name here">
  <hr>
   <h1>Hello {{yourName}}!</h1>
   <br>
   <h1><div ng-bind="yourName"></div></h1>
</div>

What i have to do to bind the data with angular?

Hope you understand my problem and give me some feedback.

Thanks,
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to