I have created this sample (jsbin) which shows a band member and an instrument he plays with.
This is how it looks :

At first , no one plays at anything , and so the instumentId is null :
s.users= [
{ id: 1, firstname: 'John', lastname: 'Lennon', instrumentId: null },
{ id: 2, firstname: 'Paul', lastname: 'McCartney', instrumentId: null},
{ id: 3, firstname: 'George', lastname: 'Harrison', instrumentId: null },
{ id: 4, firstname: 'Ringo', lastname: 'Star', instrumentId: null },
];
When I click "edit" - I have a template which is in :

And the user should choose :

All ok.
But I have 2 problems :
Question 1 :
Currently the template is in each row ( hidden) and I dont want that ! I want it to be temporary injected ( so user will be able to choose an instrument ) and then remove it from dom.
How can I do it ?
Question 2 :
The template is :
<script type=text/ng-template id='instrument.html'>
<select ng-model='instrumentDdl' >
<option ng-repeat='ins in instruments'>{{ins.id +' - '+ins.name}}</option>
</select>
</script>
So I bind the select to ng-model='instrumentDdl' . Also , the save function do this :
s.save=function (user){
console.log(s.instrumentDdl) //<----- undefined...why ?
user.instrumentId=s.instrumentDdl;
s.userUnderEdit = null;
};
But I get undefined at the console.log(s.instrumentDdl) ( s===$scope). why is that ?
PS , My goal : dynamic temporary injection , and when saved - to look like (john's only example):
