{"id":19757874,"url":"https://github.com/meepobrother/meepo-common","last_synced_at":"2026-05-01T04:34:34.995Z","repository":{"id":57294086,"uuid":"116452790","full_name":"meepobrother/meepo-common","owner":"meepobrother","description":"公共库-angular开发中常用工具","archived":false,"fork":false,"pushed_at":"2018-01-26T02:25:08.000Z","size":194,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T22:46:57.199Z","etag":null,"topics":["angular","common","functions","modules","tools"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meepobrother.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-06T04:21:00.000Z","updated_at":"2018-01-22T11:19:03.000Z","dependencies_parsed_at":"2022-08-29T09:50:44.036Z","dependency_job_id":null,"html_url":"https://github.com/meepobrother/meepo-common","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/meepobrother%2Fmeepo-common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meepobrother%2Fmeepo-common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meepobrother%2Fmeepo-common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meepobrother%2Fmeepo-common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meepobrother","download_url":"https://codeload.github.com/meepobrother/meepo-common/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241089443,"owners_count":19907748,"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":["angular","common","functions","modules","tools"],"created_at":"2024-11-12T03:21:47.004Z","updated_at":"2026-05-01T04:34:34.947Z","avatar_url":"https://github.com/meepobrother.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# common module\n\n### directive\n\n- ngEach\n\n```ts\nprops: Object = {\n    type: 'text'\n}\n```\n\n```html\n\u003cdiv *ngEach=\"let item of props\"\u003e\n    {{item.type}}\n\u003c/div\u003e\n```\n\n- ngStart \u0026\u0026 ngEnd \u0026\u0026 ngTrue  双向绑定[()]\n\n\u003e 用于第三方库如swiperjs等，判断dom渲染状态\n\n```html\n\u003cul\u003e\n    \u003cli *ngFor=\"let i of [1,2,3,4,5,6];last as l;\"\u003e\n        \u003cspan [ngStart]=\"l\" (ngStartChange)=\"renderBegin()\"\u003e\u003c/span\u003e\n    \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cul\u003e\n    \u003cli *ngFor=\"let i of [1,2,3,4,5,6];first as f;\"\u003e\n        \u003cspan [ngEnd]=\"f\" (ngEndChange)=\"renderEnd()\"\u003e\u003c/span\u003e\n    \u003c/li\u003e\n\u003c/ul\u003e\n\n\n\u003cul\u003e\n    \u003cli *ngFor=\"let i of [1,2,3,4,5,6];index as i;\"\u003e\n        \u003cspan [ngTrue]=\"i === 3\" (ngTrueChange)=\"render3State($event)\"\u003e\u003c/span\u003e\n    \u003c/li\u003e\n\u003c/ul\u003e\n\n```\n\n```ts\nrenderBegin(){\n    console.log('开始渲染第一个');\n}\n\nrenderEnd(){\n    console.log('渲染到最后一个列表');\n}\n\nrender3State(e: boolean){\n    if(e){\n        console.log(`开始渲染第三个`);\n    }else{\n        console.loog(`第三个个渲染完毕`);\n    }\n}\n\n```\n\n### services\n\n- helpersService 增减动态组件服务\n\n```ts\nconstructor(public helper: HelpersService){}\n\naddComponentRef(\n    component: Type\u003cany\u003e,\n    injector?: Injector,\n    content?: any[][],\n    ngModel?: NgModuleFactory\u003cany\u003e\n){\n    const helper = this.helper.addComponent(component,injector,content,ngModel);\n\n    // helper.destory() 删除组件\n}\n\naddTemplateRef(\n    tpl: TemplateRef\u003cany\u003e,\n    context?: Object\n){\n    const helper = this.helper.addTemplate(tpl,context);\n\n    // helper.destory() 删除template\n}\n\n```\n\n### functions\n\n```ts\nexport declare function isMeepoTrue(val: any): boolean;\nexport declare function isTrueProperty(val: any): boolean;\nexport declare function isCheckedProperty(a: any, b: any): boolean;\n/** @hidden */\nexport declare function isBoolean(val: any): val is boolean;\n/** @hidden */\nexport declare function isString(val: any): val is string;\n/** @hidden */\nexport declare function isNumber(val: any): val is number;\n/** @hidden */\nexport declare function isFunction(val: any): val is Function;\n/** @hidden */\nexport declare function isDefined(val: any): boolean;\n/** @hidden */\nexport declare function isUndefined(val: any): val is undefined;\n/** @hidden */\nexport declare function isPresent(val: any): val is any;\n/** @hidden */\nexport declare function isBlank(val: any): val is null;\n/** @hidden */\nexport declare function isObject(val: any): val is Object;\n/** @hidden */\nexport declare const isArray: (arg: any) =\u003e arg is any[];\nexport declare const isFinite: (number: number) =\u003e boolean;\nexport declare function isNaN(value: any): boolean;\nexport declare function isWindow(el: any): boolean;\nexport declare function isDocument(el: any): boolean;\nexport { isDevMode } from '@angular/core';\nexport declare function isPromise(obj: any): obj is Promise\u003cany\u003e;\nexport declare function isObservable(obj: any | Observable\u003cany\u003e): obj is Observable\u003cany\u003e;\nexport declare function isType(v: any): v is Type\u003cany\u003e;\nexport declare function isComponentView(view: any): boolean;\nexport declare function isEmbeddedView(view: any): boolean;\nexport declare function stringify(token: any): string;\nexport declare function looseIdentical(a: any, b: any): boolean;\nexport declare function getSymbolIterator(): string | symbol;\nexport declare function isListLikeIterable(obj: any): boolean;\nexport declare function areIterablesEqual(a: any, b: any, comparator: (a: any, b: any) =\u003e boolean): boolean;\nexport declare function iterateListLike(obj: any, fn: (p: any) =\u003e any): void;\nexport declare function isJsObject(o: any): boolean;\n```\n\n### global\n\n```ts\nimport {global} from 'meepo-common';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeepobrother%2Fmeepo-common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeepobrother%2Fmeepo-common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeepobrother%2Fmeepo-common/lists"}