我有一个名为StockGraph.aspx的页面,其中包含HTML
<div ng-controller="StockGraphController">
<div class="container">
<div class="row text-center">
<div class="col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-8 col-sm-offset-2 sub-head">
<h2 data-wow-delay="0.3s" class="wow rollIn animated"><strong>STOCK QUOTE </strong></h2>
<p data-wow-delay="0.3s" class="sub-head">Type In any Company name in the below Text Box to obtain the current stock value of the corresponding Company </p>
<label data-wow-delay="1.3s" class="wow rollIn animated">Try typing "Apple" </label>
<input type="text" id="symbolsearch" class="form-control" placeholder="Enter company name or symbol" ng-model="equitystock.symbol">
<button ng-click="showquote(equitystock)" class="btn btn-success">Show Quote</button>
</div>
<div class="col-lg-12 sub-head">
<div id="chartDemoContainer" style="height: 500px; min-width: 500px; margin-bottom: 30px;"></div>
</div>
</div>
</div>
</div>
我的角度控制器是这样定义的,
function StockGraphController($scope) {
$scope.showquote = function () {
var dur = 365;
var stockSymbol = $scope.equitystock.symbol;
new Markit.InteractiveChartApi(stockSymbol, dur)
}
}
我已将角度函数放在主文件中。上面的角度函数调用Stock api并在div id =&#34; chartDemoContainer&#34;中显示图表。此函数在一个简单的独立aspx文件中工作正常。但是当我使用Master - &gt; Child aspx页面设计设计相同的场景时,检索数据后的angular函数刷新了刷新Master Page的页面,因此我加载的图形会丢失!因为母版页刷新。有没有办法阻止主页刷新或在angular指令中的任何方式??
请帮忙解决问题??