AngularJS Immer den Wert eines ausgewählten dropdown-option in einer Variablen

Habe ich dropdown-Auswahl-Menü & senden möchten, in der dropdown ausgewählten Wert in request-params-api. Mein code ist...

<select class="form-control" id = "SelectionInput_reason">
   <option name="careerType" value="type_1">Career</option>
   <option name="examType" value="type_2">Exams</option>
</select>

getValue = function() {
    var selectedValue = this.value;
    var selectedText = this.options[this.selectedIndex].getAttribute('name');
    alert(selectedValue); 
    alert(selectedText); 
} 
document.getElementById('SelectionInput_reason').addEventListener('change', getValue );

Bitte nur Antworten geben in angularJS, wenn möglich...

auch, wie bekomme ich die text-Eingabe tinymceeditor in eine variable ?

$scope.tinymceModel = 'Initial content';
        $scope.getContent = function() {
          console.log('Editor content:', $scope.tinymceModel);
        };
        $scope.setContent = function() {
          $scope.tinymceModel = 'Time: ' + (new Date());
        };
        $scope.tinymceOptions = {
          selector: 'textarea',
          //plugins: 'link image code',
          toolbar: ' bold italic | undo redo | alignleft aligncenter alignright | code'
        };

HTML ist..

<div class="form-group">
     <textarea ui-tinymce="tinymceOptions" id="jander" ng-model="tinymceModel" placeholder="Ask your question" class="form-control"></textarea>
 </div>
  • Wenn u wollen, dass wir geben Antwort in angular js, bitte poste deinen code, die Ihren eckigen controller atleast.
  • der code im controller selbst, seine nur eine Funktion, die ich brauche.
InformationsquelleAutor srv | 2016-06-13
Schreibe einen Kommentar