角度URL格式问题

时间:2016-11-01 07:52:51

标签: javascript angularjs angularjs-directive

我有:

var mappedContacts = "C:/filestore/_images/contacts";

   <div data-ng-controller="SelectUserController" id="account-group-widget" data-ng-init="initContacts(mappedContacts )">

我在initiContacts方法中传递mappedContacts(使用asp.net),但在后端我得到格式化的URL:

<div data-ng-controller="SelectUserController" id="account-group-widget" data-ng-init="initContacts(mappedContacts )">

但是我得到了:

C:filestore_imagescontacts而不是C:/ filestore / _images / contacts

是否有任何Angular UI指令可以停止删除斜杠?

1 个答案:

答案 0 :(得分:0)

您可以使用:

$scope.mappedContacts = "C:/filestore/_images/contacts";