如何使用Angular Js显示hide <xsl:call-template>?

时间:2016-05-18 10:11:48

标签: c# angularjs xml xslt

当我使用Javavascript其工作Fine.with角Js我正在尝试但我没有收到警报消息如果收到警报消息如何隐藏TestOffice模板

调用模板

<xsl:template name="Page">
  <html>
    <head>
    <body>
    <form name="frmProfile" action="Test.aspx" method="POST">
    <table>
    <tr>
       <xsl:call-template name="OfficeLocation" />
        <xsl:call-template name="TestOffice" />
    </tr>
    <body>
    </form>
    </html>

如何使用Angular JS显示隐藏Xsl模板

<xsl:template name="OfficeLocation">
 <div ng-app="ProfileApp" ng-controller="ProfileCtrl">
  <tr>
    <td width="25%" align="right">
     <span class="body_text">Office Location Name :</span>
    </td>
    <td align="left">
     <select id="Test" ng-model="OfficeLocationType" name="Test" class="editbox_text" ng-change="GetValue()">
      <xsl:for-each select="/Page/DropDownData/OfficeLocation/Data">
        <xsl:choose>
        <xsl:when test="@Value=Test/Testing">
          <option value="{@Value}" selected="selected"><xsl:value-of select="@Name" /></option>
        </xsl:when>
        <xsl:otherwise>
          <option value="{@Value}"><xsl:value-of select="@Name" /></option>
        </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
      </select>
      <span class="body_text_mandatory">*</span>
      <span class="body_text_8">  required</span>
    </td>
  </tr>
  </div>
</xsl:template>

<xsl:template name="TestOffice">
<!-- TestOffice-->
 <tr>
    <td width="25%" align="right">
     <span class="body_text">TestOffice# :</span>
    </td>
    <td align="left">
      <input type="text" id="Test_No" name="Test_No" class="editbox_text" value="{Test/Test_No}" onchange="SetDirty (this);" />
    </td>
  </tr>
</xsl:template>

Js代码:

var app = angular.module('ProfileApp', []);
 app.controller('ProfileCtrl', function($scope) {
     $scope.GetValue = function () {
         var zszLicType = $scope.OfficeLocationType;
        alert(zszLicType);
    }
});

DropDown值:

1,2,3

如果我选择2隐藏TestOffice模板

如果我选择1&amp; 3显示许可证TestOffice

0 个答案:

没有答案