{"id":15496991,"url":"https://github.com/lencx/angular-hero-app","last_synced_at":"2026-04-29T21:33:11.483Z","repository":{"id":65643377,"uuid":"99814263","full_name":"lencx/angular-hero-app","owner":"lencx","description":"hero app (angular4+pug+material+sass+indexedDB)","archived":false,"fork":false,"pushed_at":"2017-09-02T15:55:22.000Z","size":1041,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-22T06:00:46.698Z","etag":null,"topics":["angular-cli","dexiejs","indexeddb","material","pug","sass"],"latest_commit_sha":null,"homepage":"https://lencx.github.io/demo/hero/","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/lencx.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":"2017-08-09T13:56:40.000Z","updated_at":"2023-02-02T06:41:47.000Z","dependencies_parsed_at":"2023-02-02T07:32:05.782Z","dependency_job_id":null,"html_url":"https://github.com/lencx/angular-hero-app","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lencx%2Fangular-hero-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lencx%2Fangular-hero-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lencx%2Fangular-hero-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lencx%2Fangular-hero-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lencx","download_url":"https://codeload.github.com/lencx/angular-hero-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246068281,"owners_count":20718503,"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-cli","dexiejs","indexeddb","material","pug","sass"],"created_at":"2024-10-02T08:29:50.914Z","updated_at":"2026-04-29T21:33:11.457Z","avatar_url":"https://github.com/lencx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AngularApp\n\nThis project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.0.\n\n## Development server\n\nRun `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n\n## Code scaffolding\n\nRun `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.\n\n## Build\n\nRun `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.\n\n## Running unit tests\n\nRun `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n## Running end-to-end tests\n\nRun `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).\nBefore running the tests make sure you are serving the app via `ng serve`.\n\n## Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).\n\n---\n---\n\n## Add Command\n\n```bash\n# clear build file\nyarn clear\n\n# uglify js\nyarn build:prod\n\n# dev server\nyarn dev\n```\n\n## Add pug template\n\n### Step\n\n\u003e Step 1\n\n```bash\nng eject\n\nyarn\n\nyarn add pug-html-loader --dev\n```\n\n![ng eject](./example/img/ng-eject.png)\n\n\u003e Step 2\n\n```js\n// edit webpack.config.js\n\"modules\": {\n    \"rules\": [\n        {\n            \"test\": /\\.pug$/,\n            \"use\": [\"raw-loader\", \"pug-html-loader\"]\n        }\n    ]\n}\n```\n\n### Pug template compilation error\n\n\u003e angular template reference variables\n\n```pug\n//- error\ninput(#heroName)\n//- ok\n\u003cinput #heroName\u003e\n//- ok\n\u003cinput ref-heroName\u003e\n```\n\n![ref var error](./example/img/ref-var-err.png)\n\n#### [Solutions: stackoverflow](https://stackoverflow.com/q/45687501/7324114?stw=2)\n\n\u003e [pug doc (attributes)](https://pugjs.org/language/attributes.html)\n\n\u003e\u003e 当遇到解决不了的问题时，换个思路也许就好了，我之前一直想着从`pug`变量入手，但现在看来应该是属性或解析规则的问题。\n\n- add doctype html to the header of the file.\n\n```pug\ndoctype html\ninput(#heroName)\n```\n\n- use pug `\u0026attributes` syntax can be used to explode an object into attributes of an element.\n\n```pug\ninput\u0026attributes({'#heroName': ''})\n```\n\n- edit `webpack.config.js` file.\n\n```js\n\"modules\": {\n    \"rules\": [\n        {\n        \"test\": /\\.pug$/,\n        \"use\": [\n          'raw-loader',\n          {\n            \"loader\": 'pug-html-loader',\n            \"options\": {\n              \"doctype\": 'html'\n            }\n          }\n        ]\n      }\n    ]\n}\n```\n\n## [More ...](./HERO.DOC.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flencx%2Fangular-hero-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flencx%2Fangular-hero-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flencx%2Fangular-hero-app/lists"}