Can we dynamically create a simple span to input with ng-model
feature only when we click on the span
.
I have already gone through the way, where i am creating both span
and input
and hiding input
in the loading by ng-hide
and only displaying input
when user is clicking on the span. but here the problem is we are binding input directly with the value by ng-model and its causing slowness and hanging problem in browser where we have large list of data (i have tested with 1000 values).
Please help me on this, I want to make all read only data in the loading and when user will click on the span then it should dynamically converted into the input box, when we make any changes on it then it should to save in the list.
Plunkr : http://plnkr.co/hwi1vXQxgaTSMzEdwcf7
HTML
<div ng-controller="myctrl">
<div ng-repeat="value in list">
<span ng-click="editThis()" tabindex="0">{{value}}</span>
</div>
</div>
CONTROLLER
app.controller("myctrl", function($scope){
$scope.list = [
"sports", "coverage", "breaking", "news", "live",
"results", "and", "complete", "sport", "information:",
"football", "basket", "tennis"
];
$scope.editThis = function(){
};
});