AngularJS View does not update our src

In this plnkr, the editable value is found inside src, but the value outside src remains empty.

Select different radio buttons in plnkr, external src will not update.

Can I find out why and how to fix it?

0
source share
2 answers

This is a typical example of a case where it ng-modeldoes not contain it ..

Here is the corresponding plunker that solves the problem.

Plunker

app.controller('testCtrl',function($scope,$timeout){
  $scope.data = {
    filteringText : ''
  };

});

, ng-include - , javascript, . , , .

PS:, $parent, . .

+1

, ng-include , ng-, , .

, {{filteringText}} , filteringText ng-.

ng-include , :

  <body ng-controller="testCtrl">


    <div ng-include src="'input.html'"></div>

  <input type="radio" ng-model="filteringText" value="">All
  <input type="radio" ng-model="filteringText" value="Add">Add
  <input type="radio" ng-model="filteringText" value="Edit">Edit
  <input type="radio" ng-model="filteringText" value="Delete">Delete
  </br>
    Outside src : {{filteringText}}

, src , , ng-model.

ng-include, $parent.value input.html, :

<input type="radio" ng-model="$parent.filteringText" value="">All
<input type="radio" ng-model="$parent.filteringText" value="Add">Add
<input type="radio" ng-model="$parent.filteringText" value="Edit">Edit
<input type="radio" ng-model="$parent.filteringText" value="Delete">Delete
<br/>
Inside src : {{$parent.filteringText}}

, ng-include.

+1

All Articles