We have some third party javascript components that are generating some html elements. I'd like to couple it with AngularJS.
I've 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' />");
};
}
but it doesn't work like excepted.
Is there any chance to get this working ?