0
Ich bin ein Neuling in angularjs.Winkel Scope-Variable funktioniert nicht in dynamisch erstellt html
Ich erstelle HTML auf der Basis des Typs (Business-Logik). Hier funktionieren einige Objekteigenschaften oder einige nicht.
Hier mein Code: -
$scope.changeObj=$scope.attributes[countInc];
switch ($scope.changeObj.type) {
case 'text':
html+='<input type="text" class="form-control" ng-value="changeObj.type">';
//Here, changeObj.type is working//
$scope.rangeShow=true;
break;
case 'select':
html='<select class="form-control" ng-options="optionsO.key as optionsO.value for optionsO in changeObj.options"></select>';
//Options unable to create. I dont know changeObj.options is working or not.//
break;
default:
}
eleDiv.html(html);
$compile(eleDiv)($scope);
Am Ansicht Teil text case
ist Arbeit, aber in select case
Optionen schaffen es nicht.