首页 新闻 赞助 找找看

angularjs中的angular.module("myApp", [])

0
悬赏园豆:20 [已关闭问题] 关闭于 2014-03-12 15:34

刚学习angularjs,我需要实现的功能是查询功能,即输入查询条件,然后以表单形式返回结果。代码如下:

// THIS IS  BUTTON CLICK SEARCH
var
app = angular.module("myApp", []); app.directive("datepicker", function () { return { restrict: "A", link: function (scope, el, attr) { el.datepicker(); } }; }) .controller("searchCtrl", function ($scope, $http) { $scope.SearchTerm = function () { var url = 'http://localhost:5100/terms?agentids=' + $scope.agentName + '&hrdate=' + $scope.date2 + '&callback=JSON_CALLBACK'; $http.jsonp(url).success(function (data) { $scope.termsInfo = data; }).error(function (data, status, headers, config) { $scope.events = "fail"; }) }; }); //this is form present. var app1 = angular.module('myTermTable', ['ngTable']); app1.controller('tableCtrl', function ($scope, ngTableParams) { var data=...(json data) $scope.tableParams = new ngTableParams({ page: 1, // show first page count: 10 // count per page }, { total: data.length, // length of data getData: function ($defer, params) { $defer.resolve(data.slice((params.page() - 1) * params.count(), params.page() * params.count())); } }); })

我发现以上两个angular.module("myApp", [])不能合并,我该如何处理这个查询操作。。急。。

土星的山羊的主页 土星的山羊 | 初学一级 | 园豆:191
提问于:2014-03-10 12:47
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册