{"_id":"angular-phonecat","_rev":"4-ce540719d05405addeca4ccea1bcd4e3","name":"angular-phonecat","description":"A tutorial application for AngularJS","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"version":"0.0.0","public":true,"name":"angular-phonecat","description":"A tutorial application for AngularJS","repository":{"type":"git","url":"https://github.com/angular/angular-phonecat"},"license":"MIT","devDependencies":{"karma":"^0.12.16","karma-chrome-launcher":"^0.1.4","karma-jasmine":"^0.1.5","protractor":"~1.0.0","http-server":"^0.6.1","tmp":"0.0.23","bower":"^1.3.1","shelljs":"^0.2.6"},"scripts":{"postinstall":"bower install","prestart":"npm install","start":"http-server -a 0.0.0.0 -p 8000","pretest":"npm install","test":"node node_modules/karma/bin/karma start test/karma.conf.js","test-single-run":"node node_modules/karma/bin/karma start test/karma.conf.js  --single-run","preupdate-webdriver":"npm install","update-webdriver":"webdriver-manager update","preprotractor":"npm run update-webdriver","protractor":"protractor test/protractor-conf.js","update-index-async":"node -e \"require('shelljs/global'); sed('-i', /\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/, '//@@NG_LOADER_START@@\\n' + cat('bower_components/angular-loader/angular-loader.min.js') + '\\n//@@NG_LOADER_END@@', 'app/index-async.html');\""},"gitHead":"96a9b5b7fa5e5667e099d25c20a4bb19992c0f72","bugs":{"url":"https://github.com/angular/angular-phonecat/issues"},"homepage":"https://github.com/angular/angular-phonecat","_id":"angular-phonecat@0.0.0","_shasum":"853e8a094a811bc5dd5570a8d71b41660cee1fbd","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"lihongwang","email":"LihongWang@fih-foxconn.com.cn"},"maintainers":[{"name":"lihongwang","email":"LihongWang@fih-foxconn.com.cn"}],"dist":{"shasum":"853e8a094a811bc5dd5570a8d71b41660cee1fbd","tarball":"https://registry.npmjs.org/angular-phonecat/-/angular-phonecat-0.0.0.tgz","integrity":"sha512-119klNnnA5+PhAS0uVzAGwBDM0eSmvkBCWuOXMiNXiFZVQWhsRDJgYgo4RvnlhcDVIODcfLd0/QkiZkBRzx6vQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoOm6xjcRvLpvBaqmnBEJm17NWuqPyRjAUkzqZ8fF48gIhAMmVpMRa7L8a3heiRj9DbOastQTJg5UFT4jPhab6Lns5"}]}}},"readme":"# AngularJS Phone Catalog Tutorial Application\n\n## Overview\n\nThis application takes the developer through the process of building a web-application using\nangular. The application is loosely based on the **Google Phone Gallery**, which no longer\nexists. Here is a historical reference: [Google Phone Gallery on WayBack](http://web.archive.org/web/20131215082038/http://www.android.com/devices/).\n\nEach tagged commit is a separate lesson teaching a single aspect of angular.\n\nThe full tutorial can be found at http://docs.angularjs.org/tutorial.\n\n## Prerequisites\n\n### Git\n\n- A good place to learn about setting up git is [here][git-github].\n- Git [home][git-home] (download, documentation).\n\n### Node.js and Tools\n\n- Get [Node.js][node-download].\n- Install the tool dependencies (`npm install`).\n\n\n## Workings of the application\n\n- The application filesystem layout structure is based on the [angular-seed] project.\n- There is no dynamic backend (no application server) for this application. Instead we fake the\n  application server by fetching static json files.\n- Read the Development section at the end to familiarize yourself with running and developing\n  an angular application.\n\n## Commits / Tutorial Outline\n\nYou can check out any point of the tutorial using\n    git checkout step-?\n\nTo see the changes which between any two lessons use the git diff command.\n    git diff step-?..step-?\n\n### step-0\n\n- Add ngApp directive to bootstrap the app.\n- Add simple template with an expression.\n\n\n### step-1\n\n- Add static html list with two phones into index.html. We will convert this static page into\n  dynamic one with the help of angular.\n\n\n### step-2\n\n- Convert the static html list into dynamic one by:\n  - creating `PhoneListCtrl` controller for the application.\n  - extracting the data from HTML, moving it into the controller as an in-memory dataset.\n  - converting the static HTML document into an Angular template with the use of the `ngRepeat`\n    directive which iterates over the dataset of phones.\n    `ngRepeat` clones its contents for each instance in the dataset and renders it into the view.\n- Add a simple unit test to show off how to write tests and run them with Karma.\n\n\n### step-3\n\n\n- Add a search box to demonstrate how:\n  - the data-binding works on input fields.\n  - to use the `filter` filter.\n  - `ngRepeat` automatically shrinks and grows the number of phones in the view.\n- Add an end-to-end test to:\n  - show how end-to-end tests are written and how to run them with Protractor.\n  - prove that the search box and the repeater are correctly wired together.\n\n\n### step-4\n\n- Add `age` property to each phone in the data model.\n- Add a `<select>` input to change the phone list order.\n- Override the default order value in the controller.\n- Add unit and e2e tests for this feature.\n\n### step-5\n\n- Replace the in-memory dataset with data loaded from the server (in\n  the form of static `phones.json` file).\n  - The `phones.json` file is loaded using the `$http` service.\n- Demonstrate the use of [services][service] and [dependency injection][DI].\n  - The [$http] service is injected into the controller through [dependency injection][DI].\n\n\n### step-6\n\n- Add phone images and links to new pages that show the phone details.\n- Add end2end tests that verify the links to the detail pages.\n- Add CSS to style the page just a notch.\n\n\n### step-7\n\n- Introduce the [$route] service which allows binding URLs for deep-linking with\n  views:\n  - Create `PhoneCatCtrl` which governs the entire app and contains $route configuration.\n  - Install `angular-route` using bower and load the `ngRoute` module.\n    (Be sure to run npm install again.)\n  - Copy route parameters to root scope `params` property for access in sub controllers.\n  - Replace the contents of `index.html` with the `ngView` directive, which will display the partial\n    template of the current route.\n\n- Create phone list route:\n  - Map `/phones` route to `PhoneListCtrl` and `partials/phones-list.html`.\n  - Preserve existing `PhoneListCtrl` controller.\n  - Move existing html from `index.html` to `partials/phone-list.html`.\n- Create phone details route:\n  - Map `/phones/<phone-id>` route to `PhoneDetailCtrl` and `partials/phones-detail.html`.\n  - Create empty placeholder `PhoneDetailsCtrl` controller.\n\n\n### step-8\n\n\n- Implement `PhoneDetailCtrl` controller to fetch the details for a specific phone from a JSON file\n  using `$http` service.\n- Update the template for the phone detailed view.\n- Add CSS to make the phone details page look \"pretty\".\n\n\n### step-9\n\n- Add custom `checkmark` filter.\n- Update phone detail template to use `checkmark` filter.\n- Add unit test for the filter.\n\n### step-10\n\nIn the phone detail view, clicking on a thumbnail image, changes the main phone image to be the\nlarge version of the thumbnail image.\n\n- Define `mainImageUrl` model variable in the `PhoneDetailCtrl` and set its default value.\n- Create `setImage()` controller method to change `mainImageUrl`.\n- Register an expression with the `ngClick` directive on thumb images to set the main image, using\n  `setImage()`.\n- Add e2e tests for this feature.\n- Add CSS to change the mouse cursor when user points at thumnail images.\n\n\n### step-11\n\n- Replace [$http] with [$resource].\n- Created a custom `Phone` service that represents the `$resource` client.\n\n\n### step-12\n\n- Add animations to the application:\n  - Animate changes to the phone list, adding, removing and reordering phones.\n  - Animate changes to the main phone image in the detail view.\n\n\n## Development with angular-phonecat\n\nThe following docs describe how you can test and develop further this application.\n\n\n### Installing dependencies\n\nThe application relies upon various node.js tools, such as Bower, Karma and Protractor.  You can\ninstall these by running:\n\n```\nnpm install\n```\n\nThis will also run bower, which will download the angular files needed for the current step of the\ntutorial.\n\nMost of the scripts described below will run this automatically but it doesn't do any harm to run\nit whenever you like.\n\n### Running the app during development\n\n- Run `npm start`\n- navigate your browser to `http://localhost:8000/app/index.html` to see the app running in your browser.\n\n### Running unit tests\n\nWe recommend using [Jasmine][jasmine] and [Karma][karma] for your unit tests/specs, but you are free\nto use whatever works for you.\n\n- Start Karma with `npm test`\n  - A browser will start and connect to the Karma server. Chrome is the default browser, others can\n  be captured by loading the same url as the one in Chrome or by changing the `test/karma.conf.js`\n  file.\n- Karma will sit and watch your application and test JavaScript files. To run or re-run tests just\n  change any of your these files.\n\n\n### End to end testing\n\nWe recommend using [Jasmine][jasmine] and [Protractor][protractor] for end-to-end testing.\n\nRequires a webserver that serves the application. See Running the app during development, above.\n\n- Serve the application: run `npm start`.\n- In a separate console run the end2end tests: `npm run protractor`. Protractor will execute the\n  end2end test scripts against the web application itself.\n  - The configuration is set up to run the tests on Chrome directly. If you want to run against\n    other browsers then you must install the webDriver, `npm run update-webdriver`, and modify the\n  configuration at `test/protractor-conf.js`.\n\n## Application Directory Layout\n\n    app/                --> all of the files to be used in production\n      css/              --> css files\n        app.css         --> default stylesheet\n      img/              --> image files\n      index.html        --> app layout file (the main html template file of the app)\n      js/               --> javascript files\n        app.js          --> the main application module\n        controllers.js  --> application controllers\n        directives.js   --> application directives\n        filters.js      --> custom angular filters\n        services.js     --> custom angular services\n        animations.js   --> hooks for running JQuery animations with ngAnimate\n      partials/         --> angular view partials (partial html templates) used by ngRoute\n        partial1.html\n        partial2.html\n      bower_components  --> 3rd party js libraries, including angular and jquery\n\n    scripts/            --> handy scripts\n      update-repo.sh       --> pull down the latest version of this repos\n                               (BE CAREFUL THIS DELETES ALL CHANGES YOU HAVE MADE)\n      private/             --> private scripts used by the Angular Team to maintain this repo\n    test/               --> test source files and libraries\n      karma.conf.js        --> config file for running unit tests with Karma\n      protractor-conf.js   --> config file for running e2e tests with Protractor\n      e2e/\n        scenarios.js       --> end-to-end specs\n      unit/             --> unit level specs/tests\n        controllersSpec.js --> specs for controllers\n        directivesSpec.js  --> specs for directives\n        filtersSpec.js     --> specs for filters\n        servicesSpec.js    --> specs for services\n\n## Contact\n\nFor more information on AngularJS please check out http://angularjs.org/\n\n[7 Zip]: http://www.7-zip.org/\n[angular-seed]: https://github.com/angular/angular-seed\n[DI]: http://docs.angularjs.org/guide/di\n[directive]: http://docs.angularjs.org/guide/directive\n[filterFilter]: http://docs.angularjs.org/api/ng/filter/filter\n[git-home]: http://git-scm.com\n[git-github]: http://help.github.com/set-up-git-redirect\n[ngRepeat]: http://docs.angularjs.org/api/ng/directive/ngRepeat\n[ngView]: http://docs.angularjs.org/api/ngRoute/directive/ngView\n[node-download]: http://nodejs.org/download/\n[$resource]: http://docs.angularjs.org/api/ngResource/service/$resource\n[$route]: http://docs.angularjs.org/api/ngRoute/service/$route\n[protractor]: https://github.com/angular/protractor\n[jasmine]: http://pivotal.github.com/jasmine/\n[karma]: http://karma-runner.github.io\n","maintainers":[{"name":"lihongwang","email":"LihongWang@fih-foxconn.com.cn"}],"time":{"modified":"2022-06-13T02:56:23.586Z","created":"2015-01-30T09:13:45.385Z","0.0.0":"2015-01-30T09:13:45.385Z"},"homepage":"https://github.com/angular/angular-phonecat","repository":{"type":"git","url":"https://github.com/angular/angular-phonecat"},"bugs":{"url":"https://github.com/angular/angular-phonecat/issues"},"license":"MIT","readmeFilename":"README.md"}