我需要ng
点击以处理新标签以及自选标签。网址会根据条件动态显示。
HTML:
<a ng-href="{{myPathVariable }} " ng-click=" GoToThemes()" class="shift-left">Themes</a>
控制器:
$scope.GoToThemes = function () {
if ($sessionStorage.CategoryObj == null || $sessionStorage.CategoryObj == undefined || jQuery.isEmptyObject($sessionStorage.CategoryObj) || $scope.order.CategoryObj == undefined || $scope.order.CategoryObj == null || jQuery.isEmptyObject($scope.order.CategoryObj))
{
$scope.myPathVariable="/featured/themes";
}
else {
$scope.myPathVariable = "/" + $sessionStorage.CategoryObj.Alias.replace(/[\. ,:-]+/g, "-").toLowerCase() + "/themes";
}
答案 0 :(得分:0)
如果我正确理解了您的问题,您可以使用表达式作为目标属性:
<a target="{{conditionToBlank?'_blank':'_self'}}" ng-href="{{myPathVariable }} " ng-click=" GoToThemes()" class="shift-left">Themes</a>