到「視圖/ userspace.html」,它採用「UserspaceController」NG單擊內部納克重複我使用routeProvider路由不工作
「視圖/ userspace.html」認識到這一點控制器使得請求$ http請求。這個請求的工作文件,我可以看到「views/userspace.html」(在ng-repeat內)的值。但是,在同一個控制器中,我定義了$scope.videoClick
函數,但似乎不起作用。任何想法爲什麼?
var application = angular.module("tss.application",
[
"ngRoute",
"ui.bootstrap"
]);
application.config(function($routeProvider)
{
$routeProvider
.when("/", {
templateUrl : "views/main.html",
controller: "LoginController"
})
.when("/files", {
templateUrl : "views/userspace.html",
controller: "UserspaceController"
});
});
userspace_controller.js
angular.module('tss.application').controller("UserspaceController",
function($scope, $log, $http, $uibModal)
{
$http(
{
url : "/dirlist",
method : "GET",
}).then(function successCallback(response)
{
$scope.lists = response.data;
},
function errorCallback(response)
{
window.alert("Dir list could not be get");
});
$scope.videoClick = function()
{
$log.info('received.');
$uibModal.open(
{
templateUrl: '/views/content.html',
});
};
});
userspace.html
<li ng-repeat="list in lists" ng-click="videoClick(list.src)">{{list.name}}</li>
nop..still不工作 – Nishant
@Nishant我可以看到你的代碼嗎? – Sajeetharan
https://1drv.ms/u/s!AntZxg2kwlRrixPHx4Ws7-s7hO6n – Nishant