Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在jquery对话框中使用AngularJS_Javascript_Angularjs - Fatal编程技术网

Javascript 在jquery对话框中使用AngularJS

Javascript 在jquery对话框中使用AngularJS,javascript,angularjs,Javascript,Angularjs,我正在尝试使用ng repeat用一些用户信息填充弹出窗口。甚至没有从弹出页面调用控制器。我不知道我做错了什么。有人能给我指一下正确的方向吗。下面是更好理解的代码 app.js .state('SelectProfile', { url: "/profile/selectprofile/operation:operation&ProfileId:ProfileId", template: "", views: {

我正在尝试使用ng repeat用一些用户信息填充弹出窗口。甚至没有从弹出页面调用控制器。我不知道我做错了什么。有人能给我指一下正确的方向吗。下面是更好理解的代码

app.js

.state('SelectProfile', {
          url: "/profile/selectprofile/operation:operation&ProfileId:ProfileId",
          template: "",
          views: {
              "tabView": {
                  templateUrl: function (params) { return '/Admin/Profile/Index?id=' + params.id; },
                  controller: 'profileControllerList', onExit: function () {
                      $('#loading-spinner-container').show();
                      alert("hadem");
                  }
              },
              "tabTop": {
                  templateUrl: function (params) { return '/admin/profile/view/' + params.id; },
              }
          }
              , controller: 'profileController',
          onExit: function () {
              $('.loading-spinner-container').show();
          }
      })
controller('selectProfilesController', ['$scope', '$http', 'DataServices', 'usSpinnerService', '$stateParams',
    function ($scope, $http, DataServices, usSpinnerService, $stateParams) {
        $scope.loading = true;
        DataServices.getProfiles().then(function (successResult) {
            alert("ma nafx");
            $scope.ProfileObjects = successResult.data;
            $('#loading-spinner-container,.loading-spinner-container').hide();
            $scope.loading = false;
        });
    }
]);
controllers.js

.state('SelectProfile', {
          url: "/profile/selectprofile/operation:operation&ProfileId:ProfileId",
          template: "",
          views: {
              "tabView": {
                  templateUrl: function (params) { return '/Admin/Profile/Index?id=' + params.id; },
                  controller: 'profileControllerList', onExit: function () {
                      $('#loading-spinner-container').show();
                      alert("hadem");
                  }
              },
              "tabTop": {
                  templateUrl: function (params) { return '/admin/profile/view/' + params.id; },
              }
          }
              , controller: 'profileController',
          onExit: function () {
              $('.loading-spinner-container').show();
          }
      })
controller('selectProfilesController', ['$scope', '$http', 'DataServices', 'usSpinnerService', '$stateParams',
    function ($scope, $http, DataServices, usSpinnerService, $stateParams) {
        $scope.loading = true;
        DataServices.getProfiles().then(function (successResult) {
            alert("ma nafx");
            $scope.ProfileObjects = successResult.data;
            $('#loading-spinner-container,.loading-spinner-container').hide();
            $scope.loading = false;
        });
    }
]);
弹出页面

<tr ng-repeat="prof in ProfileObjects | filter:FirstName.LastName">
                    <td>
                        {{prof.Photo}}
                    </td>
                    <td>
                        {{prof.FirstName}}
                    </td>
                    <td>
                        {{prof.LastName}}
                    </td>
                    <td>
                        {{prof.CurrentCompanyName}}
                    </td>
                    <td>
                        {{prof.CurrentTitle}}
                    </td>
                    <td>
                        <span class="glyphicon glyphicon-ok" ng-show="!prof.IsDeleted"></span>
                    </td>

                    <td>
                        @Html.ActionLink("Select", "SelectedProfile", new { operation = ViewBag.Operation, Id = 1, CompanyId = ViewBag.CompanyId, ProfileId = ViewBag.ProfileId }, new { @class = "btn btn-default btn-sm pull-right" })
                    </td>
                </tr>

{{教授照片}
{{prof.FirstName}}
{{prof.LastName}}
{{prof.CurrentCompanyName}
{{prof.CurrentTitle}}
@ActionLink(“Select”,“SelectedProfile”,新建{operation=ViewBag.operation,Id=1,CompanyId=ViewBag.CompanyId,ProfileId=ViewBag.ProfileId},新建{@class=“btn btn default btn sm pull right”})

您可能正在将呼叫路由到ASP.NET MVC controller.plz check。相反,您应该使用ng clickok调用AngularJS控制器上的方法。我使用ng click now调用AngularJS控制器。我无法使用ng repeat填充弹出窗口。profileobject仍然为空。您需要在控制器中的模型上设置profileobject。我已经完成了以下代码:
controller('appController',['$scope','http','DataServices','usSpinnerService','stateParams',function($scope,$http,DataServices,usSpinnerService,$stateParams){$scope.removePlayer=function(){DataServices.getProfiles().then(function(successResult){$scope.ProfileObjects=successResult.data;$(“#btnTriggerTest”).trigger('click');console.log($scope.ProfileObjects);}}]);
很抱歉格式设置不好,但我无法使“工作”:您可以共享详细代码吗。例如,您如何打开弹出窗口。如果您在弹出窗口中使用模型,则在尝试打开弹出窗口时,您需要传递模型配置文件对象。