Html 当点击按钮调用";HideProduct激励措施”;什么都没有发生
我在这里面临的主要问题是,我有两个几乎相同的div和两个指令。两者之间的主要区别在于,一方面,大多数变量都被更改为产品,另一方面是全局性的,因为我需要在今后的道路上进行大量的修饰性更改 全局指令和HTML完全按照预期工作。当单击该div中的“Close”按钮时,所有内容都会变为“display:none”,而当单击productIncent div中的“Close”按钮时,HideProductIncensions()函数似乎甚至都不会被调用 控制器和指令是否相互干扰Html 当点击按钮调用";HideProduct激励措施”;什么都没有发生,html,angularjs,angularjs-ng-click,Html,Angularjs,Angularjs Ng Click,我在这里面临的主要问题是,我有两个几乎相同的div和两个指令。两者之间的主要区别在于,一方面,大多数变量都被更改为产品,另一方面是全局性的,因为我需要在今后的道路上进行大量的修饰性更改 全局指令和HTML完全按照预期工作。当单击该div中的“Close”按钮时,所有内容都会变为“display:none”,而当单击productIncent div中的“Close”按钮时,HideProductIncensions()函数似乎甚至都不会被调用 控制器和指令是否相互干扰 angular.modul
angular.module('ProductSelectorApp-main')
.directive('getGlobalIncentives', function (myFactory, serverData, $rootScope) {
return {
restrict: 'E',
template: '<button class="slds-button slds-button_brand" ng-click="showGlobalIncentives()">Incentives</button>',
controller: function ($scope, $modal) {
// $scope.selectedCurrency=[{ConversionRate:1.0 ,IsoCode:"USD" }];
$scope.showGlobalIncentives = function() {
document.getElementById('globalIncent').style.display='block';
$scope.isRequestProcessing = false;
}
$scope.hideGlobalIncentives = function() {
document.getElementById('globalIncent').style.display='none';
$scope.isRequestProcessing = false;
}
}
}
});
angular.module('ProductSelectorApp-main')
.directive('getProductIncentives', function (myFactory, serverData, $rootScope) {
return {
restrict: 'E',
template: '<button class="slds-button slds-button_brand" ng-click="showProductIncentives()">Incentives</button>',
controller: function ($scope, $modal) {
this.name='testController';
// $scope.selectedCurrency=[{ConversionRate:1.0 ,IsoCode:"USD" }];
$scope.showProductIncentives = function() {
document.getElementById('productIncent').style.display='block';
$scope.isRequestProcessing = false;
}
$scope.hideProductIncentives = function() {
document.getElementById('productIncent').innerHTML='';
$scope.isRequestProcessing = false;
}
}
}
});
角度模块('ProductSelectorApp-main')
.directive('GetGlobalInctives',函数(myFactory,serverData,$rootScope){
返回{
限制:'E',
模板:“激励措施”,
控制器:功能($scope$modal){
//$scope.selectedCurrency=[{ConversionRate:1.0,IsoCode:“USD”}];
$scope.showGlobalInctives=函数(){
document.getElementById('globalinent').style.display='block';
$scope.isRequestProcessing=false;
}
$scope.hideGlobalIncentives=函数(){
document.getElementById('globalinent').style.display='none';
$scope.isRequestProcessing=false;
}
}
}
});
角度模块('ProductSelectorApp-main')
.directive('GetProductIncentitives',函数(myFactory,serverData,$rootScope){
返回{
限制:'E',
模板:“激励措施”,
控制器:功能($scope$modal){
this.name='testController';
//$scope.selectedCurrency=[{ConversionRate:1.0,IsoCode:“USD”}];
$scope.showProductIncentitives=函数(){
document.getElementById('productIncent').style.display='block';
$scope.isRequestProcessing=false;
}
$scope.HIDEPRODUCT=function(){
document.getElementById('productIncent')。innerHTML='';
$scope.isRequestProcessing=false;
}
}
}
});
HTML:
**结束**
品名
PBP:
RCP
有奖励的RCP:
净价:
选中/取消选中全部
激励
年度价格上涨
%
$
基金
%
$
多类别
%
$
多通道
%
$
总类别
%
$
增值
%
$
<div id="globalIncent" class="white_content">
**<button class="astext" style="float:right;" ng-click="hideGlobalIncentives()">Close</button>**
<table>
<tr>
<th>
<div class="slds-truncate" >Product Name</div>
</th>
</tr>
<tr>
<td style="font-weight: bold; padding:2px;"><div class="slds-truncate" >PBP: </div></td>
<td>
</td>
<td></td>
<td style="font-weight: bold; padding:2px;"><div class="slds-truncate" >RCP</div></td>
<td>
</td>
</tr>
<tr>
<td style="font-weight: bold; padding:2px;"><div class="slds-truncate" >RCP with Incentives: </div></td>
<td>
</td>
<td></td>
<td style="font-weight: bold; padding:2px;"><div class="slds-truncate" >Net Price: </div></td>
<td>
</td>
</tr>
</table>
<div class="slds-border_bottom" style="padding:5px;"></div>
<div class="slds-checkbox" style="float:left;padding-bottom:10px;padding-top:10px;">
<input type="checkbox" name="options" id="CheckUnCheckAll" value="Check" checked="" />
<label class="slds-checkbox__label" for="CheckUnCheckAll">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Check/ UnCheck All</span>
</label>
</div>
<table>
<tr>
<th>Incentive</th>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Global Annual Price Increase" value="Annual Price Increase" checked="" />
<label class="slds-checkbox__label" for="Global Annual Price Increase">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Annual Price Increase</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Global Fund" value="Fund" checked="" />
<label class="slds-checkbox__label" for="Global Fund">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Fund</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Global Multi-Category" value="Multi-Category" checked="" />
<label class="slds-checkbox__label" for="Global Multi-Category">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Multi-Category</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Global Multi Channel" value="Multi Channel" checked="" />
<label class="slds-checkbox__label" for="Global Multi Channel">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Multi Channel</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Global Total Category" value="Total Category" checked="" />
<label class="slds-checkbox__label" for="Global Total Category">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Total Category</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Global Value Add" value="Value Add" checked="" />
<label class="slds-checkbox__label" for="Global Value Add">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Value Add</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Global Additioanl Incentive" value="Additional Incentive" checked="" />
<label class="slds-checkbox__label" for="Global Additioanl Incentive">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Additional Incentive</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
</table>
<div class="slds-border_bottom" style="padding:5px;"></div>
<table>
<tbody>
<tr>
<td>
<div style="display:block">
<div class="slds-truncate" style="float:left; font-weight:bold;">Overall Incentives % </div>
</div>
</td>
<td>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td width="100%">
<div style="float:right;padding:5px;">
<button class="slds-button slds-button_brand">Reset</button>
</div>
<div style="float:right;padding:5px;">
<button class="slds-button slds-button_brand">Apply</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- PRODUCT INCENTIVE DIV-->
<div id="productIncent" class="white_content" ng-controller="testController">
**<button class="astext" style="float:right;" ng-click="hideProductIncentives()" >Close</button>**
<table>
<tr>
<th>
<div class="slds-truncate" >Product Name</div>
</th>
</tr>
<tr>
<td style="font-weight: bold; padding:2px;"><div class="slds-truncate" >PBP: </div></td>
<td>
</td>
<td></td>
<td style="font-weight: bold; padding:2px;"><div class="slds-truncate" >RCP</div></td>
<td>
</td>
</tr>
<tr>
<td style="font-weight: bold; padding:2px;"><div class="slds-truncate" >RCP with Incentives: </div></td>
<td>
</td>
<td></td>
<td style="font-weight: bold; padding:2px;"><div class="slds-truncate" >Net Price: </div></td>
<td>
</td>
</tr>
</table>
<div class="slds-border_bottom" style="padding:5px;"></div>
<div class="slds-checkbox" style="float:left;padding-bottom:10px;padding-top:10px;">
<input type="checkbox" name="options" id="CheckUnCheckAll" value="Check" checked="" />
<label class="slds-checkbox__label" for="CheckUnCheckAll">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Check/ UnCheck All</span>
</label>
</div>
<table>
<tr>
<th>Incentive</th>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Product Annual Price Increase" value="Annual Price Increase" checked="" />
<label class="slds-checkbox__label" for="Product Annual Price Increase">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Annual Price Increase</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Product Fund" value="Fund" checked="" />
<label class="slds-checkbox__label" for="Product Fund">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Fund</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Product Multi-Category" value="Multi-Category" checked="" />
<label class="slds-checkbox__label" for="Product Multi-Category">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Multi-Category</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Product Multi Channel" value="Multi Channel" checked="" />
<label class="slds-checkbox__label" for="Product Multi Channel">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Multi Channel</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Product Total Category" value="Total Category" checked="" />
<label class="slds-checkbox__label" for="Product Total Category">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Total Category</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Product Value Add" value="Value Add" checked="" />
<label class="slds-checkbox__label" for="Product Value Add">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Value Add</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
<tr>
<td style="padding-right:10px;">
<div class="slds-checkbox">
<input type="checkbox" name="options" id="Product Additioanl Incentive" value="Additional Incentive" checked="" />
<label class="slds-checkbox__label" for="Product Additioanl Incentive">
<span class="slds-checkbox_faux"></span>
<span class="slds-form-element__label">Additional Incentive</span>
</label>
</div>
</td>
<td>
<div class="slds-select_container" style="float:right">
<select class="slds-select" id="select-01">
<option>%</option>
<option>$</option>
</select>
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
</table>
<div class="slds-border_bottom" style="padding:5px;"></div>
<table>
<tbody>
<tr>
<td>
<div style="display:block">
<div class="slds-truncate" style="float:left; font-weight:bold;">Overall Incentives % </div>
</div>
</td>
<td>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
<div class="slds-form-element__control slds-size--3-of-12" style="float:right;">
<input type="text" id="text-input-id-1" required="" class="slds-input" />
</div>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td width="100%">
<div style="float:right;padding:5px;">
<button class="slds-button slds-button_brand">Reset</button>
</div>
<div style="float:right;padding:5px;">
<button class="slds-button slds-button_brand">Apply</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>