angularjs 自定义指令 弹出框

前端之家收集整理的这篇文章主要介绍了angularjs 自定义指令 弹出框前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  • define(['app','../cons/serviceCons','../services/httpHandler'],
  • function(app,serviceCons) {
  • 'use strict';
  • app.directive('wcsTaskSearch',['wcs.ops.request','wcsDialog',
  • function(request,wcsDialog) {
  • return {
  • restrict: "A",
  • scope: {
  • taskId: "=",
  • },
  • replace: true,
  • //templateUrl:'common/template/taskSearch.html',
  • controller: ['$scope',
  • function($scope) {}],
  • link: function(scope,element,attrs) {
  • var taskSearch = function() {};
  • taskSearch.prototype = {
  • loading: false,
  • critical: {},
  • totalCount: 0,
  • currentPage: 1,
  • pageSize: 10,
  • searchData: [],
  • search: function(critical,flag) {
  • this.searchData = [];
  • this.critical = critical;
  • if (!flag) {
  • this.currentPage = 1;
  • }
  • critical.pageIndex = this.currentPage;
  • critical.pageSize = this.pageSize;
  • this.loading = true;
  • var _this = this;
  • //console.log(critical);
  • request.sendRequestWithUrl(serviceCons.localServiceUrl + '/ops/taskMgr/taskList',{
  • params: critical
  • }).then(function(resp) {
  • if (resp.data.errorCode == '0') {
  • _this.totalCount = resp.data.data.totalCount;
  • _this.searchData = resp.data.data.data || [];
  • }
  • _this.loading = false;
  • });
  • },
  • pageChanged: function() {
  • this.search(this.critical,1);
  • }
  • };
  • var showTaskDialog = function() {
  • wcsDialog.showDialogByUrl('common/template/taskSearchDialog.html',null,{
  • task: new taskSearch()
  • }).result.then(function(result) {
  • if (result) {
  • scope.taskId = result.TASK_ID;
  • }
  • });
  • };
  • $(element).on("click",showTaskDialog);
  • }
  • };
  • }]);
  • });- 这里是列表文本
原文链接:https://www.f2er.com/angularjs/148830.html

猜你在找的Angularjs相关文章