We have some third-party javascript components that generate some html elements. I would like to associate it with AngularJS.
I tried this code
<div ng-controller="ExpensesCtrl">
<form id="expensesform">
<input type="text" ng-model="expense.name" />
<input type="text" ng-model="expense.amount" />
</form>
<button ng-click="add()">Add</button>expense | json
</div>
function ExpensesCtrl($scope) {
$scope.expense = {};
$scope.add = function () {
$("#expensesform").append("<input type='text' ng-model='expense.age' />");
};
}
http://jsfiddle.net/tChNh/
but it does not work as excluded.
Is there a chance to get this job?
source
share