{"id":16326707,"url":"https://github.com/chrisyip/ng-partialize","last_synced_at":"2025-09-10T19:38:22.132Z","repository":{"id":36565394,"uuid":"40871299","full_name":"chrisyip/ng-partialize","owner":"chrisyip","description":null,"archived":false,"fork":false,"pushed_at":"2015-08-26T07:36:23.000Z","size":143,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T06:41:31.319Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisyip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-17T06:49:32.000Z","updated_at":"2015-08-23T17:26:30.000Z","dependencies_parsed_at":"2022-09-12T10:01:38.936Z","dependency_job_id":null,"html_url":"https://github.com/chrisyip/ng-partialize","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-partialize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-partialize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-partialize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fng-partialize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisyip","download_url":"https://codeload.github.com/chrisyip/ng-partialize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235711,"owners_count":22036966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T23:09:21.557Z","updated_at":"2025-05-14T22:12:16.753Z","avatar_url":"https://github.com/chrisyip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ng-partialize\n\nExample:\n\nCommon logic (`common.js`) :\n\n```js\nangular.module('myApp', [])\n  .controller('demoCtrl', function ($scope) {\n    $scope.query(function (items) {\n      $scope.items = items\n\n      $scope.pagination = {\n        count: items.length,\n        total: getTotal()\n      }\n    })\n\n    $scope.onClick = function (item) {\n      $scope.showDetail(item)\n    }\n  })\n```\n\nWeb app A:\n\n```html\n\u003cscript src=\"angular.js\"\u003c/script\u003e\n\u003cscript src=\"ng-partialize.js\"\u003c/script\u003e\n\u003cscript src=\"common.js\"\u003c/script\u003e\n\u003cscript src=\"list.js\"\u003c/script\u003e\n\n\u003cul ng-controller=\"demoCtrl\"\u003e\n  \u003cli ng-repeat=\"item in list\" ng-click=\"onClick(item)\"\u003e\n\u003c/ul\u003e\n\n\u003cpagination=\"pagination\"\u003e\n```\n\n`list.js`:\n\n```js\nangular.module('myApp')\n  .beforeController('demoCtrl', function ($scope, List) {\n    $scope.query = function (cb) {\n      return List.query(cb)\n    }\n\n    $scope.showDetail = function () { /* do something */ }\n  })\n  .afterController('demoCtrl', function ($scope) {\n    $scope.$watch('items', function (val) {\n      if (val) {\n        $scope.list = val.map(function (item) { /* do something */ })\n      }\n    })\n  })\n```\n\nWeb app B:\n\n```html\n\u003cscript src=\"angular.js\"\u003c/script\u003e\n\u003cscript src=\"ng-partialize.js\"\u003c/script\u003e\n\u003cscript src=\"common.js\"\u003c/script\u003e\n\u003cscript src=\"article.js\"\u003c/script\u003e\n\n\u003csection ng-controller=\"demoCtrl\"\u003e\n  \u003carticle ng-repeat=\"item in articles\" ng-click=\"onClick(item)\"\u003e\u003c/article\u003e\n\u003c/section\u003e\n\n\u003cpagination=\"pagination\"\u003e\n```\n\n`article.js`:\n\n```js\nangular.module('myApp')\n  .beforeController('demoCtrl', function ($scope, Article) {\n    $scope.query = function (cb) {\n      return Article.query(cb)\n    }\n\n    $scope.showDetail = function () { /* do something */ }\n  })\n  .afterController('demoCtrl', function ($scope) {\n    $scope.$watch('items', function (val) {\n      if (val) {\n        $scope.articles = val.map(function (item) { /* do something */ })\n      }\n    })\n  })\n```\n\n# Author\n\n[Chris Yip](https://github.com/chrisyip)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fng-partialize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisyip%2Fng-partialize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fng-partialize/lists"}