I have a Select element like this
<select class="form-control" id="designation" ng-model="employee.designation" ng-init="select Designation = options[0]" ng-options="d for d in designations" required></select>
Now i want to set the initial value for this element like 'Select Designation' to be the default value. how can i achieve this? I am able to bind the values but i am not able to set the default value, can anyone help me !!!
the controller code is this
(function () {
var app = angular.module('mainApp', []);
app.controller('employeeCtrl', ['$scope', '$http', function ($scope, $http) {
this.employee = {};
$http.get('/Data/Designation.json').success(function (data) {
debugger;
$scope.designations = data;
}).error(function () {
alert('error !!!');
});
$scope.formSubmit = function () {
debugger;
};
}]);
})();