we have a very chaotic angularjs code, completely impossible to refactor,
and the problem is the options in a select are in the wrong order:
$scope.dlgXbin120 = {
name: '',
title: '',
sensor_id: 0,
device_id: 0,
binindex: 0,
messchannel: 0,
measure: 0,
measureSelect: '0',
measureOptions: [
{id: '0', name: $scope.translate.coreTranslations.no_measurement ||
$scope.translate.coreTranslationsFallback.no_measurement},
{id: '1', name: $scope.translate.coreTranslations.register_contact ||
$scope.translate.coreTranslationsFallback.register_contact}
]
};
$scope.changeValuedlgXbin120 = function () {
$scope.dlgXbin120.measureOptions
=
[
{id: '0', name:
$scope.translate.coreTranslations.no_measurement ||
$scope.translate.coreTranslationsFallback.no_measurement},
{id: '1', name:
$scope.translate.coreTranslations.register_contact ||
$scope.translate.coreTranslationsFallback.register_contact}
]
};
...and is does NOT help to change it to measureSelect: '1':
$scope.dlgXbin120 = {
name: '',
title: '',
sensor_id: 0,
device_id: 0,
binindex: 0,
messchannel: 0,
measure: 0,
measureSelect: '1',
measureOptions: [
{id: '0', name: $scope.translate.coreTranslations.no_measurement ||
$scope.translate.coreTranslationsFallback.no_measurement},
{id: '1', name: $scope.translate.coreTranslations.register_contact ||
$scope.translate.coreTranslationsFallback.register_contact}
]
};
$scope.changeValuedlgXbin120 = function () {
$scope.dlgXbin120.measureOptions
=
[
{id: '0', name:
$scope.translate.coreTranslations.no_measurement ||
$scope.translate.coreTranslationsFallback.no_measurement},
{id: '1', name:
$scope.translate.coreTranslations.register_contact ||
$scope.translate.coreTranslationsFallback.register_contact}
]
};
...and it does also not help to change the order with 1 first:
$scope.dlgXbin120 = {
name: '',
title: '',
sensor_id: 0,
device_id: 0,
binindex: 0,
messchannel: 0,
measure: 0,
measureSelect: '0',
measureOptions: [
{id: '1', name: $scope.translate.coreTranslations.register_contact ||
$scope.translate.coreTranslationsFallback.register_contact},{id: '0', name:
$scope.translate.coreTranslations.no_measurement ||
$scope.translate.coreTranslationsFallback.no_measurement}
]
};
$scope.changeValuedlgXbin120 = function () {
$scope.dlgXbin120.measureOptions
=
[
{id: '1', name: $scope.translate.coreTranslations.register_contact ||
$scope.translate.coreTranslationsFallback.register_contact},
{id: '0', name:
$scope.translate.coreTranslations.no_measurement ||
$scope.translate.coreTranslationsFallback.no_measurement}
]
};
...because of that that, now i want to use "plain vanilla" javascript:
window.onload = function(e){
try
{
var messbin120Elements = document.getElementsByName("messbin120");
console.log("Length of messbin120Elements: " +
messbin120Elements.length);
messbin120Element = messbin120Elements[0];
console.log("Length of messbin120Element: " + messbin120Element.length);
// messbin120Element.innerHTML = "";
var option0 = messbin120Element[0].outerHTML;
var option1 = messbin120Element[1].outerHTML;
// messbin120Element[1].innerHTML = option0;
// messbin120Element[0].innerHTML = option1;
messbin120Element.innerHTML = option1 + option0;
}
catch(err)
{
alert(err);
}
}
...but that does, WTF, also not help. that was the controller part.
the view part (php file) is:
<select name="messbin120" class=" form-control input-sm"
ng-model="dlgXbin120.measureSelect">
<option ng-repeat="option in dlgXbin120.measureOptions"
value="{{option.id}}">{{option.name}}</option>
</select>
how to solve that problem?
thank you very much for your feedbacks.
best regards,
jan
--
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.