我有以下要求:
读取 URL 参数,加载页面上的 2 个下拉菜单并使用 URL 参数中的值预填充它们。然后使用下拉值调用方法来加载网格。
这是我到目前为止所做的:
在控制器上,我正在使用 $location.search() 检查参数,如果它们存在,则调用一些方法。我将此代码放在控制器的末尾。但是当调用控制器内部的方法时,REST 调用不会通过,而是在控制器总负载发生后调用。
感谢任何帮助!
示例场景:
function abc(){/*some code*/}
function xyz(){/*some code*/}
function abd(){/*some code*/}
if(typeof $location.search().paramaName !=undefined){
/*Read URL params. preselect the current drop down by calling abc,xyz.use the values to call abd() which makes a REST API call to load the data on the page. */
}