var demoApp = angular.module('myApp', []);
demoApp.controller('languageController', function($scope, $http) {
$scope.languages = [
{id:1, name:'C#'},
{id:2, name:'MVC'},
{id:3, name:'SQL'},
{id:4, name:'AngularJs'},
{id:5, name:'jQuery'},
{id:6, name:'Javascript'},
{id:7, name:'HTML'},
{id:8, name:'CSS'},
{id:9, name:'Linq'},
{id:10, name:'EntityFramework'}
];
$scope.defaultSelected = [
{id:2, name:'MVC'},
{id:4, name:'AngularJs'}
];
$scope.checkID = function(name){
var dat = $scope.defaultSelected.find(v=> v.name === name);
if(dat) {return true }else{ return false}
}
$scope.submit = function() {
$scope.result = $scope.loopData;
};
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="myApp">
<div class="wrapper wrapper-content middlealigen col-sm-12" ng-controller="languageController">
<div ng-repeat="language in languages">
<input type="checkbox" ng-model="language.checked" id="language{{$index}}" ng-checked="checkID(language.name)" />
<label for="language{{$index}}" ng-bind="language.name"></label>
</div>
</div>
</body>