小编Jen*_*eaf的帖子

使用AngularJS $ location从URL中获取查询字符串中的值

关于$ location.search,文档说,

在没有任何参数的情况下调用时返回当前url的搜索部分(作为对象).

在我的网址中,我的查询字符串有一个没有值的参数'?test_user_bLzgB'.'$ location.search()'也返回一个对象.我如何获得实际文本?

javascript angularjs

94
推荐指数
7
解决办法
22万
查看次数

如何以编程方式派生Windows下载文件夹"%USERPROFILE%/ Downloads"?

在.Net中,我们可以检索"特殊文件夹"的路径,例如Documents/Desktop等.今天我试图找到一种方法来获取"下载"文件夹的路径,但它看起来并不特别.

我知道我可以做'C:\ Users\Username\Downloads',但这似乎是一个丑陋的解决方案.那么如何使用.Net来修复路径呢?

.net registry environment-variables special-folders registrykey

23
推荐指数
2
解决办法
2万
查看次数

如何通过动态更改其键值参数来使用Angular $ location来设置我的新url位置?

假设我有一个RESTful端点,它接受一系列方面来查询数据.以下是一些例子:

example.com/search?type=Doctor&location=Boston,MA&radius=2  
example.com/search?type=Facility&location=Wayne,NJ&radius=3&gender=f  
example.com/search?type=Doctor&location=Patterson,NJ
Run Code Online (Sandbox Code Playgroud)

我的模块接受查询对象来执行搜索:

console.log(query);
{
  type:'Doctor',
  location:'Boston,MA',
  radius:'2'
}

$scope.getSearch = function(query){
  var search = $search.search(query);
  search.getResults(function(results){
    $scope.results = results;
  });
}
Run Code Online (Sandbox Code Playgroud)

这些方面通过Web表单中的本地模型传递:

 <input type="text" ng-model="query.location"/>
 <input type="text" ng-model="query.radius"/>
 <button type="button" ng-click="getSearch(query)">Search</button>
Run Code Online (Sandbox Code Playgroud)

getResults函数的成功回调中,我试图将查询参数附加到URL,如上例所示:

$scope.getSearch = function(query){
  var search = $search.search(query);
  search.getResults(function(results){
    $scope.results = results;
    search.appendQueryToURL(query);
  });
}
Run Code Online (Sandbox Code Playgroud)

如何在AngularJS中动态追加URL参数?

javascript angularjs

16
推荐指数
1
解决办法
4万
查看次数

uiGridConstants.filter下的可用条件常量是什么?

我是否错过了在一个地方记录uiGrid字段的所有可用uiGridConstants的链接?我正在使用columnDefs过滤器,发现EQUAL不起作用.就在那时我意识到uiGridConstants的所有条件常量都没有中央文档.

columnDefs:
 [ {   }
    , { field: '_pointXID', filter
        : {
            condition: uiGridConstants.filter.CONTAINS, placeholder: '%PATTERN%'
        }, headerCellClass: $scope.whatfilter}
    , { field: '_statU16', width: "5%", filter
        : {
            condition: uiGridConstants.filter.EQUAL, placeholder: '=='
        }, headerCellClass: $scope.whatfilter}
    , { field: '_valDoub', width: "5%", enableFiltering: false }

 ]
Run Code Online (Sandbox Code Playgroud)

EQUAL不是其中之一,而且我怎么知道?!

angular-ui-grid ui-grid

8
推荐指数
1
解决办法
4825
查看次数