{"id":21879957,"url":"https://github.com/ku00/angular-phonecat","last_synced_at":"2025-03-22T00:20:29.197Z","repository":{"id":80654893,"uuid":"62948497","full_name":"ku00/angular-phonecat","owner":"ku00","description":null,"archived":false,"fork":false,"pushed_at":"2017-12-24T04:54:23.000Z","size":1554,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T18:34:20.257Z","etag":null,"topics":["syakyo","tutorial"],"latest_commit_sha":null,"homepage":"https://github.com/angular/angular-phonecat","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/ku00.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-09T12:27:41.000Z","updated_at":"2018-01-13T12:17:25.000Z","dependencies_parsed_at":"2023-03-12T11:47:09.483Z","dependency_job_id":null,"html_url":"https://github.com/ku00/angular-phonecat","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/ku00%2Fangular-phonecat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ku00%2Fangular-phonecat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ku00%2Fangular-phonecat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ku00%2Fangular-phonecat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ku00","download_url":"https://codeload.github.com/ku00/angular-phonecat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244886533,"owners_count":20526448,"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":["syakyo","tutorial"],"created_at":"2024-11-28T08:19:08.554Z","updated_at":"2025-03-22T00:20:29.170Z","avatar_url":"https://github.com/ku00.png","language":"JavaScript","readme":"# angular-seed — the seed for AngularJS apps\n\nThis project is an application skeleton for a typical [AngularJS](http://angularjs.org/) web app.\nYou can use it to quickly bootstrap your angular webapp projects and dev environment for these\nprojects.\n\nThe seed contains a sample AngularJS application and is preconfigured to install the Angular\nframework and a bunch of development and testing tools for instant web development gratification.\n\nThe seed app doesn't do much, just shows how to wire two controllers and views together.\n\n\n## Getting Started\n\nTo get you started you can simply clone the angular-seed repository and install the dependencies:\n\n### Prerequisites\n\nYou need git to clone the angular-seed repository. You can get git from\n[http://git-scm.com/](http://git-scm.com/).\n\nWe also use a number of node.js tools to initialize and test angular-seed. You must have node.js and\nits package manager (yarn) installed.  You can get them from [http://nodejs.org/](http://nodejs.org/).\n\n### Clone angular-seed\n\nClone the angular-seed repository using [git][git]:\n\n```\ngit clone https://github.com/angular/angular-seed.git\ncd angular-seed\n```\n\nIf you just want to start a new project without the angular-seed commit history then you can do:\n\n```bash\ngit clone --depth=1 https://github.com/angular/angular-seed.git \u003cyour-project-name\u003e\n```\n\nThe `depth=1` tells git to only pull down one commit worth of historical data.\n\n### Install Dependencies\n\nWe have two kinds of dependencies in this project: tools and angular framework code.  The tools help\nus manage and test the application.\n\n* We get the tools we depend upon via `yarn`, the [node package manager][yarn].\n* We get the angular code via `bower`, a [client-side code package manager][bower].\n\nWe have preconfigured `yarn` to automatically run `bower` so we can simply do:\n\n```\nyarn install\n```\n\nBehind the scenes this will also call `bower install`.  You should find that you have two new\nfolders in your project.\n\n* `node_modules` - contains the yarn packages for the tools we need\n* `app/bower_components` - contains the angular framework files\n\n*Note that the `bower_components` folder would normally be installed in the root folder but\nangular-seed changes this location through the `.bowerrc` file.  Putting it in the app folder makes\nit easier to serve the files by a webserver.*\n\n### Run the Application\n\nWe have preconfigured the project with a simple development web server.  The simplest way to start\nthis server is:\n\n```\nyarn start\n```\n\nNow browse to the app at `http://localhost:8000/index.html`.\n\n\n\n## Directory Layout\n\n```\napp/                    --\u003e all of the source files for the application\n  app.css               --\u003e default stylesheet\n  components/           --\u003e all app specific modules\n    version/              --\u003e version related components\n      version.js                 --\u003e version module declaration and basic \"version\" value service\n      version_test.js            --\u003e \"version\" value service tests\n      version-directive.js       --\u003e custom directive that returns the current app version\n      version-directive_test.js  --\u003e version directive tests\n      interpolate-filter.js      --\u003e custom interpolation filter\n      interpolate-filter_test.js --\u003e interpolate filter tests\n  view1/                --\u003e the view1 view template and logic\n    view1.html            --\u003e the partial template\n    view1.js              --\u003e the controller logic\n    view1_test.js         --\u003e tests of the controller\n  view2/                --\u003e the view2 view template and logic\n    view2.html            --\u003e the partial template\n    view2.js              --\u003e the controller logic\n    view2_test.js         --\u003e tests of the controller\n  app.js                --\u003e main application module\n  index.html            --\u003e app layout file (the main html template file of the app)\n  index-async.html      --\u003e just like index.html, but loads js files asynchronously\nkarma.conf.js         --\u003e config file for running unit tests with Karma\ne2e-tests/            --\u003e end-to-end tests\n  protractor-conf.js    --\u003e Protractor config file\n  scenarios.js          --\u003e end-to-end scenarios to be run by Protractor\n```\n\n## Testing\n\nThere are two kinds of tests in the angular-seed application: Unit tests and end-to-end tests.\n\n### Running Unit Tests\n\nThe angular-seed app comes preconfigured with unit tests. These are written in\n[Jasmine][jasmine], which we run with the [Karma Test Runner][karma]. We provide a Karma\nconfiguration file to run them.\n\n* the configuration is found at `karma.conf.js`\n* the unit tests are found next to the code they are testing and are named as `..._test.js`.\n\nThe easiest way to run the unit tests is to use the supplied yarn script:\n\n```\nyarn test\n```\n\nThis script will start the Karma test runner to execute the unit tests. Moreover, Karma will sit and\nwatch the source and test files for changes and then re-run the tests whenever any of them change.\nThis is the recommended strategy; if your unit tests are being run every time you save a file then\nyou receive instant feedback on any changes that break the expected code functionality.\n\nYou can also ask Karma to do a single run of the tests and then exit.  This is useful if you want to\ncheck that a particular version of the code is operating as expected.  The project contains a\npredefined script to do this:\n\n```\nyarn run test-single-run\n```\n\n\n### End to end testing\n\nThe angular-seed app comes with end-to-end tests, again written in [Jasmine][jasmine]. These tests\nare run with the [Protractor][protractor] End-to-End test runner.  It uses native events and has\nspecial features for Angular applications.\n\n* the configuration is found at `e2e-tests/protractor-conf.js`\n* the end-to-end tests are found in `e2e-tests/scenarios.js`\n\nProtractor simulates interaction with our web app and verifies that the application responds\ncorrectly. Therefore, our web server needs to be serving up the application, so that Protractor\ncan interact with it.\n\n```\nyarn start\n```\n\nIn addition, since Protractor is built upon WebDriver we need to install this.  The angular-seed\nproject comes with a predefined script to do this:\n\n```\nyarn run update-webdriver\n```\n\nThis will download and install the latest version of the stand-alone WebDriver tool.\n\nOnce you have ensured that the development web server hosting our application is up and running\nand WebDriver is updated, you can run the end-to-end tests using the supplied yarn script:\n\n```\nyarn run protractor\n```\n\nThis script will execute the end-to-end tests against the application being hosted on the\ndevelopment server.\n\n\n## Updating Angular\n\nPreviously we recommended that you merge in changes to angular-seed into your own fork of the project.\nNow that the angular framework library code and tools are acquired through package managers (yarn and\nbower) you can use these tools instead to update the dependencies.\n\nYou can update the tool dependencies by running:\n\n```\nyarn upgrade\n```\n\nThis will find the latest versions that match the version ranges specified in the `package.json` file.\n\nYou can update the Angular dependencies by running:\n\n```\nbower update\n```\n\nThis will find the latest versions that match the version ranges specified in the `bower.json` file.\n\n\n## Loading Angular Asynchronously\n\nThe angular-seed project supports loading the framework and application scripts asynchronously.  The\nspecial `index-async.html` is designed to support this style of loading.  For it to work you must\ninject a piece of Angular JavaScript into the HTML page.  The project has a predefined script to help\ndo this.\n\n```\nyarn run update-index-async\n```\n\nThis will copy the contents of the `angular-loader.js` library file into the `index-async.html` page.\nYou can run this every time you update the version of Angular that you are using.\n\n\n## Serving the Application Files\n\nWhile angular is client-side-only technology and it's possible to create angular webapps that\ndon't require a backend server at all, we recommend serving the project files using a local\nwebserver during development to avoid issues with security restrictions (sandbox) in browsers. The\nsandbox implementation varies between browsers, but quite often prevents things like cookies, xhr,\netc to function properly when an html page is opened via `file://` scheme instead of `http://`.\n\n\n### Running the App during Development\n\nThe angular-seed project comes preconfigured with a local development webserver.  It is a node.js\ntool called [http-server][http-server].  You can start this webserver with `yarn start` but you may choose to\ninstall the tool:\n\n```\nsudo yarn global add http-server\n```\n\nThen you can start your own development web server to serve static files from a folder by\nrunning:\n\n```\nhttp-server -a localhost -p 8000\n```\n\nAlternatively, you can choose to configure your own webserver, such as apache or nginx. Just\nconfigure your server to serve the files under the `app/` directory.\n\n\n### Running the App in Production\n\nThis really depends on how complex your app is and the overall infrastructure of your system, but\nthe general rule is that all you need in production are all the files under the `app/` directory.\nEverything else should be omitted.\n\nAngular apps are really just a bunch of static html, css and js files that just need to be hosted\nsomewhere they can be accessed by browsers.\n\nIf your Angular app is talking to the backend server via xhr or other means, you need to figure\nout what is the best way to host the static files to comply with the same origin policy if\napplicable. Usually this is done by hosting the files by the backend server or through\nreverse-proxying the backend server(s) and webserver(s).\n\n\n## Continuous Integration\n\n### Travis CI\n\n[Travis CI][travis] is a continuous integration service, which can monitor GitHub for new commits\nto your repository and execute scripts such as building the app or running tests. The angular-seed\nproject contains a Travis configuration file, `.travis.yml`, which will cause Travis to run your\ntests when you push to GitHub.\n\nYou will need to enable the integration between Travis and GitHub. See the Travis website for more\ninstruction on how to do this.\n\n### CloudBees\n\nCloudBees have provided a CI/deployment setup:\n\n\u003ca href=\"https://grandcentral.cloudbees.com/?CB_clickstart=https://raw.github.com/CloudBees-community/angular-js-clickstart/master/clickstart.json\"\u003e\n\u003cimg src=\"https://d3ko533tu1ozfq.cloudfront.net/clickstart/deployInstantly.png\"/\u003e\u003c/a\u003e\n\nIf you run this, you will get a cloned version of this repo to start working on in a private git repo,\nalong with a CI service (in Jenkins) hosted that will run unit and end to end tests in both Firefox and Chrome.\n\n\n## Contact\n\nFor more information on AngularJS please check out http://angularjs.org/\n\n[git]: http://git-scm.com/\n[bower]: http://bower.io\n[yarn]: https://yarnpkg.com\n[node]: http://nodejs.org\n[protractor]: https://github.com/angular/protractor\n[jasmine]: http://jasmine.github.io\n[karma]: http://karma-runner.github.io\n[travis]: https://travis-ci.org/\n[http-server]: https://github.com/nodeapps/http-server\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fku00%2Fangular-phonecat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fku00%2Fangular-phonecat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fku00%2Fangular-phonecat/lists"}