i want disable image with angular js i used a function to do that i have this error Cannot create property 'type' on string:
Controller :
$scope.ActivePlaceSpotCAM = function (idPlace, typePlace) {
var res = null;
angular.forEach($scope.ListPlaces, function (value, key) {
angular.forEach(value.type, function (value ,key) {
if (value.type = typePlace && value.id == idPlace) {
res = value;
}
});
});
return res;
}
html :
<div class="SvgPicto col-lg-2 col-md-2 col-sm-2 col-xs-2">
<img src="@Url.Content("~/Resources/Common/pic.svg")" ng-init="configuredPlaces[@nbPlace] == place.type" ng-if="ActivePlaceSpotCAM(place.id,place.type)"/>
</div>
(value.type = typePlace && value.id == idPlace)should be(value.type == typePlace && value.id == idPlace)