<select ng-model="selectedFaculty">
<option ng-repeat="faculty in faculties"
value="{{faculty}}">{{faculty.Name}}</option>
</select>
<h1>Selected faculty: {{selectedFaculty}}</h1>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.faculties=[{Id:1,Name:'Economics'},{Id:2,Name:'IT'},{Id:3,Name:'Tourism'}];
});
</script>
If I will put selectedFaculty.Name instead of selectedFaculty then nothing
is displayed in the page.
How can this be explained?
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" 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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.