{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","examples":{"codes":[]},"results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Generators","type":"basic","slug":"angular-generators","excerpt":"","body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Separate multiple words with a dash (e.g.: add-items)\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"Do **not** append the word Service, Component or Directive. They will be automatically generated for you.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Auto-import\",\n  \"body\": \"All generators will automatically update your imports and module in the correct file. For components, the `index.components.js` will be automatically updated. You can disable this behavior by adding the `--no-import` flag or from your `config/generators.php`.\"\n}\n[/block]\nBelow is a list of the available generators:\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"artisan ng:page {settings}\"\n}\n[/block]\nCreates a new page in `/angular/app/pages` by generating the following:\n\n* angular/app/pages/settings.page.html\n* angular/app/pages/settings.less\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"artisan ng:component {user-profile}\"\n}\n[/block]\nCreates a new component in `/angular/components/` by generating the following:\n\n* angular/directives/components/user-profile.component.html\n* angular/directives/components/user-profile.component.js\n* angular/directives/components/user-profile.less\n\nand an ngDescribe test file\n* tests/angular/app/components/user-profile.spec.js\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Components vs Directives\",\n  \"body\": \"**Make sure** to read the [official angular docs](https://docs.angularjs.org/guide/component) on the difference between Components & Directives.\\n\\nIn most scenarios, you would use components as the building block for your User Interface.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"artisan ng:directive {is-admin}\"\n}\n[/block]\nCreates a new directive in `/angular/directives/` by generating the following:\n\n* angular/directives/is-admin/is-admin.directive.js\n\nand an ngDescribe test file\n* tests/angular/directives/is-admin.spec.js\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"artisan ng:dialog {login}\"\n}\n[/block]\nCreates a new dialog in `/angular/dialogs/` by generating the following:\n\n* angular/dialogs/login/login.html\n* angular/dialogs/login/login.dialog.js\n* angular/dialogs/login/login.less\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"artisan ng:service {cache}\"\n}\n[/block]\nCreates a new service in `/angular/services/` by generating the following:\n\n* angular/services/cache.service.js\n\nand an ngDescribe test file\n* tests/angular/services/cache.spec.js\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"artisan ng:filter {ucfirst}\"\n}\n[/block]\nCreates a new service in `/angular/filters/` by generating the following:\n\n* angular/filters/ucfirst.filter.js\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"artisan ng:config {http}\"\n}\n[/block]\nCreates a new service in `/angular/config/` by generating the following:\n\n* angular/config/http.config.js","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57ffd85f755a2e1700c2bb2a","project":"567083021dabd80d00b122ae","parentDoc":null,"user":"567082433a32d20d00c45cab","version":{"version":"3.4","version_clean":"3.4.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["57ffd85f755a2e1700c2bb06","57ffd85f755a2e1700c2bb07","57ffd85f755a2e1700c2bb08","57ffd85f755a2e1700c2bb09","57ffd85f755a2e1700c2bb0a","57ffd85f755a2e1700c2bb0b","57ffd85f755a2e1700c2bb0c","57ffd85f755a2e1700c2bb0d"],"_id":"57ffd85f755a2e1700c2bb05","project":"567083021dabd80d00b122ae","releaseDate":"2016-10-13T18:54:23.018Z","__v":1,"createdAt":"2016-10-13T18:54:23.018Z"},"__v":0,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Angular Generators","slug":"angular-generators","order":2,"from_sync":false,"reference":false,"_id":"57ffd85f755a2e1700c2bb08","__v":0,"version":"57ffd85f755a2e1700c2bb05","createdAt":"2015-12-18T23:11:07.668Z","project":"567083021dabd80d00b122ae"},"githubsync":"","createdAt":"2015-12-18T23:12:27.539Z"}
[block:callout] { "type": "info", "body": "Separate multiple words with a dash (e.g.: add-items)" } [/block] [block:callout] { "type": "success", "body": "Do **not** append the word Service, Component or Directive. They will be automatically generated for you." } [/block] [block:callout] { "type": "info", "title": "Auto-import", "body": "All generators will automatically update your imports and module in the correct file. For components, the `index.components.js` will be automatically updated. You can disable this behavior by adding the `--no-import` flag or from your `config/generators.php`." } [/block] Below is a list of the available generators: [block:api-header] { "type": "basic", "title": "artisan ng:page {settings}" } [/block] Creates a new page in `/angular/app/pages` by generating the following: * angular/app/pages/settings.page.html * angular/app/pages/settings.less [block:api-header] { "type": "basic", "title": "artisan ng:component {user-profile}" } [/block] Creates a new component in `/angular/components/` by generating the following: * angular/directives/components/user-profile.component.html * angular/directives/components/user-profile.component.js * angular/directives/components/user-profile.less and an ngDescribe test file * tests/angular/app/components/user-profile.spec.js [block:callout] { "type": "info", "title": "Components vs Directives", "body": "**Make sure** to read the [official angular docs](https://docs.angularjs.org/guide/component) on the difference between Components & Directives.\n\nIn most scenarios, you would use components as the building block for your User Interface." } [/block] [block:api-header] { "type": "basic", "title": "artisan ng:directive {is-admin}" } [/block] Creates a new directive in `/angular/directives/` by generating the following: * angular/directives/is-admin/is-admin.directive.js and an ngDescribe test file * tests/angular/directives/is-admin.spec.js [block:api-header] { "type": "basic", "title": "artisan ng:dialog {login}" } [/block] Creates a new dialog in `/angular/dialogs/` by generating the following: * angular/dialogs/login/login.html * angular/dialogs/login/login.dialog.js * angular/dialogs/login/login.less [block:api-header] { "type": "basic", "title": "artisan ng:service {cache}" } [/block] Creates a new service in `/angular/services/` by generating the following: * angular/services/cache.service.js and an ngDescribe test file * tests/angular/services/cache.spec.js [block:api-header] { "type": "basic", "title": "artisan ng:filter {ucfirst}" } [/block] Creates a new service in `/angular/filters/` by generating the following: * angular/filters/ucfirst.filter.js [block:api-header] { "type": "basic", "title": "artisan ng:config {http}" } [/block] Creates a new service in `/angular/config/` by generating the following: * angular/config/http.config.js