Full Code of angular/angular-seed for AI

master 8c695627a6c3 cached
25 files
25.3 KB
7.2k tokens
1 requests
Download .txt
Repository: angular/angular-seed
Branch: master
Commit: 8c695627a6c3
Files: 25
Total size: 25.3 KB

Directory structure:
gitextract_z9fm4uis/

├── .gitignore
├── .jshintrc
├── .travis.yml
├── LICENSE
├── README.md
├── app/
│   ├── app.css
│   ├── app.js
│   ├── core/
│   │   └── version/
│   │       ├── interpolate-filter.js
│   │       ├── interpolate-filter.spec.js
│   │       ├── version-directive.js
│   │       ├── version-directive.spec.js
│   │       ├── version.js
│   │       └── version.spec.js
│   ├── index-async.html
│   ├── index.html
│   ├── view1/
│   │   ├── view1.html
│   │   ├── view1.js
│   │   └── view1.spec.js
│   └── view2/
│       ├── view2.html
│       ├── view2.js
│       └── view2.spec.js
├── e2e-tests/
│   ├── protractor.conf.js
│   └── scenarios.js
├── karma.conf.js
└── package.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
logs/*
!.gitkeep
node_modules/
app/lib/
tmp
.DS_Store
.idea

================================================
FILE: .jshintrc
================================================
{
  "strict": "global",
  "globals": {
    // AngularJS
    "angular": false,

    // AngularJS mocks
    "module": false,
    "inject": false,

    // Jasmine
    "jasmine": false,
    "describe": false,
    "beforeEach": false,
    "afterEach": false,
    "it": false,
    "expect": false,

    // Protractor
    "browser": false,
    "element": false,
    "by": false
  }
}


================================================
FILE: .travis.yml
================================================
dist: trusty

language: node_js
node_js:
  - 10

addons:
  chrome: stable

cache:
  directories:
    - "$HOME/.npm"

install:
  - npm install

script:
  - npm run test-single-run -- --browsers ChromeHeadless
  - (npm start > /dev/null &) && npm run protractor -- --capabilities.chromeOptions.args headless


================================================
FILE: LICENSE
================================================
The MIT License

Copyright (c) 2010-2016 Google, Inc. http://angularjs.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.



================================================
FILE: README.md
================================================
# `angular-seed` — the seed for AngularJS apps

This project is an application skeleton for a typical [AngularJS][angularjs] web app. You can use it
to quickly bootstrap your angular webapp projects and dev environment for these projects.

The seed contains a sample AngularJS application and is preconfigured to install the AngularJS
framework and a bunch of development and testing tools for instant web development gratification.

The seed app doesn't do much, just shows how to wire two controllers and views together.


## Getting Started

To get you started you can simply clone the `angular-seed` repository and install the dependencies:

### Prerequisites

You need git to clone the `angular-seed` repository. You can get git from [here][git].

We also use a number of Node.js tools to initialize and test `angular-seed`. You must have Node.js
and its package manager (npm) installed. You can get them from [here][node].

### Clone `angular-seed`

Clone the `angular-seed` repository using git:

```
git clone https://github.com/angular/angular-seed.git
cd angular-seed
```

If you just want to start a new project without the `angular-seed` commit history then you can do:

```
git clone --depth=1 https://github.com/angular/angular-seed.git <your-project-name>
```

The `depth=1` tells git to only pull down one commit worth of historical data.

### Install Dependencies

We have two kinds of dependencies in this project: tools and AngularJS framework code. The tools
help us manage and test the application.

* We get the tools we depend upon and the AngularJS code via `npm`, the [Node package manager][npm].
* In order to run the end-to-end tests, you will also need to have the
  [Java Development Kit (JDK)][jdk] installed on your machine. Check out the section on
  [end-to-end testing](#e2e-testing) for more info.

We have preconfigured `npm` to automatically copy the downloaded AngularJS files to `app/lib` so we
can simply do:

```
npm install
```

Behind the scenes this will also call `npm run copy-libs`, which copies the AngularJS files and
other front end dependencies. After that, you should find out that you have two new directories in
your project.

* `node_modules` - contains the npm packages for the tools we need
* `app/lib` - contains the AngularJS framework files and other front end dependencies

*Note copying the AngularJS files from `node_modules` to `app/lib` makes it easier to serve the
files by a web server.*

### Run the Application

We have preconfigured the project with a simple development web server. The simplest way to start
this server is:

```
npm start
```

Now browse to the app at [`localhost:8000/index.html`][local-app-url].


## Directory Layout

```
app/                  --> all of the source files for the application
  app.css               --> default stylesheet
  core/                 --> all app specific modules
    version/              --> version related components
      version.js                 --> version module declaration and basic "version" value service
      version_test.js            --> "version" value service tests
      version-directive.js       --> custom directive that returns the current app version
      version-directive_test.js  --> version directive tests
      interpolate-filter.js      --> custom interpolation filter
      interpolate-filter_test.js --> interpolate filter tests
  view1/                --> the view1 view template and logic
    view1.html            --> the partial template
    view1.js              --> the controller logic
    view1_test.js         --> tests of the controller
  view2/                --> the view2 view template and logic
    view2.html            --> the partial template
    view2.js              --> the controller logic
    view2_test.js         --> tests of the controller
  app.js                --> main application module
  index.html            --> app layout file (the main html template file of the app)
  index-async.html      --> just like index.html, but loads js files asynchronously
e2e-tests/            --> end-to-end tests
  protractor-conf.js    --> Protractor config file
  scenarios.js          --> end-to-end scenarios to be run by Protractor
karma.conf.js         --> config file for running unit tests with Karma
package.json          --> Node.js specific metadata, including development tools dependencies
package-lock.json     --> Npm specific metadata, including versions of installed development tools dependencies
```


## Testing

There are two kinds of tests in the `angular-seed` application: Unit tests and end-to-end tests.

### Running Unit Tests

The `angular-seed` app comes preconfigured with unit tests. These are written in [Jasmine][jasmine],
which we run with the [Karma][karma] test runner. We provide a Karma configuration file to run them.

* The configuration is found at `karma.conf.js`.
* The unit tests are found next to the code they are testing and have a `.spec.js` suffix (e.g.
  `view1.spec.js`).

The easiest way to run the unit tests is to use the supplied npm script:

```
npm test
```

This script will start the Karma test runner to execute the unit tests. Moreover, Karma will start
watching the source and test files for changes and then re-run the tests whenever any of them
changes.
This is the recommended strategy; if your unit tests are being run every time you save a file then
you receive instant feedback on any changes that break the expected code functionality.

You can also ask Karma to do a single run of the tests and then exit. This is useful if you want to
check that a particular version of the code is operating as expected. The project contains a
predefined script to do this:

```
npm run test-single-run
```


<a name="e2e-testing"></a>
### Running End-to-End Tests

The `angular-seed` app comes with end-to-end tests, again written in [Jasmine][jasmine]. These tests
are run with the [Protractor][protractor] End-to-End test runner. It uses native events and has
special features for AngularJS applications.

* The configuration is found at `e2e-tests/protractor-conf.js`.
* The end-to-end tests are found in `e2e-tests/scenarios.js`.

Protractor simulates interaction with our web app and verifies that the application responds
correctly. Therefore, our web server needs to be serving up the application, so that Protractor can
interact with it.

**Before starting Protractor, open a separate terminal window and run:**

```
npm start
```

In addition, since Protractor is built upon WebDriver, we need to ensure that it is installed and
up-to-date. The `angular-seed` project is configured to do this automatically before running the
end-to-end tests, so you don't need to worry about it. If you want to manually update the WebDriver,
you can run:

```
npm run update-webdriver
```

Once you have ensured that the development web server hosting our application is up and running, you
can run the end-to-end tests using the supplied npm script:

```
npm run protractor
```

This script will execute the end-to-end tests against the application being hosted on the
development server.

**Note:**
Under the hood, Protractor uses the [Selenium Standalone Server][selenium], which in turn requires
the [Java Development Kit (JDK)][jdk] to be installed on your local machine. Check this by running
`java -version` from the command line.

If JDK is not already installed, you can download it [here][jdk-download].


## Updating AngularJS and other dependencies

Since the AngularJS framework library code and tools are acquired through package managers (e.g.
npm) you can use these tools to easily update the dependencies. Simply run the preconfigured script:

```
npm run update-deps
```

This will call `npm update` and `npm run copy-libs`, which in turn will find and install the latest
versions that match the version ranges specified in the `package.json` file.

If you want to update a dependency to a version newer than what the specificed range would permit,
you can change the version range in `package.json` and then run `npm run update-deps` as usual.


## Loading AngularJS Asynchronously

The `angular-seed` project supports loading the framework and application scripts asynchronously.
The special `index-async.html` is designed to support this style of loading. For it to work you must
inject a piece of AngularJS JavaScript into the HTML page. The project has a predefined script to help
do this:

```
npm run update-index-async
```

This will copy the contents of the `angular-loader.js` library file into the `index-async.html`
page. You can run this every time you update the version of AngularJS that you are using.


## Serving the Application Files

While AngularJS is client-side-only technology and it is possible to create AngularJS web apps that
do not require a backend server at all, we recommend serving the project files using a local
web server during development to avoid issues with security restrictions (sandbox) in browsers. The
sandbox implementation varies between browsers, but quite often prevents things like cookies, XHR,
etc to function properly when an HTML page is opened via the `file://` scheme instead of `http://`.

### Running the App during Development

The `angular-seed` project comes preconfigured with a local development web server. It is a Node.js
tool called [http-server][http-server]. You can start this web server with `npm start`, but you may
choose to install the tool globally:

```
sudo npm install -g http-server
```

Then you can start your own development web server to serve static files from any folder by running:

```
http-server -a localhost -p 8000
```

Alternatively, you can choose to configure your own web server, such as Apache or Nginx. Just
configure your server to serve the files under the `app/` directory.

### Running the App in Production

This really depends on how complex your app is and the overall infrastructure of your system, but
the general rule is that all you need in production are the files under the `app/` directory.
Everything else should be omitted.

AngularJS apps are really just a bunch of static HTML, CSS and JavaScript files that need to be
hosted somewhere they can be accessed by browsers.

If your AngularJS app is talking to the backend server via XHR or other means, you need to figure
out what is the best way to host the static files to comply with the same origin policy if
applicable. Usually this is done by hosting the files by the backend server or through
reverse-proxying the backend server(s) and web server(s).


## Continuous Integration

### Travis CI

[Travis CI][travis] is a continuous integration service, which can monitor GitHub for new commits to
your repository and execute scripts such as building the app or running tests. The `angular-seed`
project contains a Travis configuration file, `.travis.yml`, which will cause Travis to run your
tests when you push to GitHub.

You will need to enable the integration between Travis and GitHub. See the
[Travis website][travis-docs] for instructions on how to do this.


## Contact

For more information on AngularJS please check out [angularjs.org][angularjs].


[angularjs]: https://angularjs.org/
[git]: https://git-scm.com/
[http-server]: https://github.com/indexzero/http-server
[jasmine]: https://jasmine.github.io/
[jdk]: https://wikipedia.org/wiki/Java_Development_Kit
[jdk-download]: http://www.oracle.com/technetwork/java/javase/downloads
[karma]: https://karma-runner.github.io/
[local-app-url]: http://localhost:8000/index.html
[node]: https://nodejs.org/
[npm]: https://www.npmjs.org/
[protractor]: http://www.protractortest.org/
[selenium]: http://docs.seleniumhq.org/
[travis]: https://travis-ci.org/
[travis-docs]: https://docs.travis-ci.com/user/getting-started


================================================
FILE: app/app.css
================================================
/* app css stylesheet */

.menu {
  list-style: none;
  border-bottom: 0.1em solid black;
  margin-bottom: 2em;
  padding: 0 0 0.5em;
}

.menu:before {
  content: "[";
}

.menu:after {
  content: "]";
}

.menu > li {
  display: inline;
}

.menu > li + li:before {
  content: "|";
  padding-right: 0.3em;
}


================================================
FILE: app/app.js
================================================
'use strict';

// Declare app level module which depends on views, and core components
angular.module('myApp', [
  'ngRoute',
  'myApp.view1',
  'myApp.view2',
  'myApp.version'
]).
config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
  $locationProvider.hashPrefix('!');

  $routeProvider.otherwise({redirectTo: '/view1'});
}]);


================================================
FILE: app/core/version/interpolate-filter.js
================================================
'use strict';

angular.module('myApp.version.interpolate-filter', [])

.filter('interpolate', ['version', function(version) {
  return function(text) {
    return String(text).replace(/\%VERSION\%/mg, version);
  };
}]);


================================================
FILE: app/core/version/interpolate-filter.spec.js
================================================
'use strict';

describe('myApp.version module', function() {
  beforeEach(module('myApp.version'));

  describe('interpolate filter', function() {
    beforeEach(module(function($provide) {
      $provide.value('version', 'TEST_VER');
    }));

    it('should replace VERSION', inject(function(interpolateFilter) {
      expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after');
    }));
  });
});


================================================
FILE: app/core/version/version-directive.js
================================================
'use strict';

angular.module('myApp.version.version-directive', [])

.directive('appVersion', ['version', function(version) {
  return function(scope, elm, attrs) {
    elm.text(version);
  };
}]);


================================================
FILE: app/core/version/version-directive.spec.js
================================================
'use strict';

describe('myApp.version module', function() {
  beforeEach(module('myApp.version'));

  describe('app-version directive', function() {
    it('should print current version', function() {
      module(function($provide) {
        $provide.value('version', 'TEST_VER');
      });
      inject(function($compile, $rootScope) {
        var element = $compile('<span app-version></span>')($rootScope);
        expect(element.text()).toEqual('TEST_VER');
      });
    });
  });
});


================================================
FILE: app/core/version/version.js
================================================
'use strict';

angular.module('myApp.version', [
  'myApp.version.interpolate-filter',
  'myApp.version.version-directive'
])

.value('version', '0.1');


================================================
FILE: app/core/version/version.spec.js
================================================
'use strict';

describe('myApp.version module', function() {
  beforeEach(module('myApp.version'));

  describe('version service', function() {
    it('should return current version', inject(function(version) {
      expect(version).toEqual('0.1');
    }));
  });
});


================================================
FILE: app/index-async.html
================================================
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" href="lib/html5-boilerplate/dist/css/normalize.css">
  <link rel="stylesheet" href="lib/html5-boilerplate/dist/css/main.css">
  <style>
    [ng-cloak] {
      display: none;
    }
  </style>
  <script src="lib/html5-boilerplate/dist/js/vendor/modernizr-2.8.3.min.js"></script>
  <script>
    // include AngularJS loader, which allows the files to load in any order
    //@@NG_LOADER_START@@
    // You need to run `npm run update-index-async` to inject the AngularJS async code here
    //@@NG_LOADER_END@@

    // include a third-party async loader library
    /*!
     * $script.js v1.3
     * https://github.com/ded/script.js
     * Copyright: @ded & @fat - Dustin Diaz, Jacob Thornton 2011
     * Follow our software http://twitter.com/dedfat
     * License: MIT
     */
    !function(a,b,c){function t(a,c){var e=b.createElement("script"),f=j;e.onload=e.onerror=e[o]=function(){e[m]&&!/^c|loade/.test(e[m])||f||(e.onload=e[o]=null,f=1,c())},e.async=1,e.src=a,d.insertBefore(e,d.firstChild)}function q(a,b){p(a,function(a){return!b(a)})}var d=b.getElementsByTagName("head")[0],e={},f={},g={},h={},i="string",j=!1,k="push",l="DOMContentLoaded",m="readyState",n="addEventListener",o="onreadystatechange",p=function(a,b){for(var c=0,d=a.length;c<d;++c)if(!b(a[c]))return j;return 1};!b[m]&&b[n]&&(b[n](l,function r(){b.removeEventListener(l,r,j),b[m]="complete"},j),b[m]="loading");var s=function(a,b,d){function o(){if(!--m){e[l]=1,j&&j();for(var a in g)p(a.split("|"),n)&&!q(g[a],n)&&(g[a]=[])}}function n(a){return a.call?a():e[a]}a=a[k]?a:[a];var i=b&&b.call,j=i?b:d,l=i?a.join(""):b,m=a.length;c(function(){q(a,function(a){h[a]?(l&&(f[l]=1),o()):(h[a]=1,l&&(f[l]=1),t(s.path?s.path+a+".js":a,o))})},0);return s};s.get=t,s.ready=function(a,b,c){a=a[k]?a:[a];var d=[];!q(a,function(a){e[a]||d[k](a)})&&p(a,function(a){return e[a]})?b():!function(a){g[a]=g[a]||[],g[a][k](b),c&&c(d)}(a.join("|"));return s};var u=a.$script;s.noConflict=function(){a.$script=u;return this},typeof module!="undefined"&&module.exports?module.exports=s:a.$script=s}(this,document,setTimeout)

    // load all of the dependencies asynchronously.
    $script([
      'lib/angular/angular.js',
      'lib/angular-route/angular-route.js',
      'app.js',
      'view1/view1.js',
      'view2/view2.js',
      'core/version/version.js',
      'core/version/version-directive.js',
      'core/version/interpolate-filter.js'
    ], function() {
      // when all is done, execute bootstrap AngularJS application
      angular.bootstrap(document, ['myApp']);
    });
  </script>
  <title>My AngularJS App</title>
  <link rel="stylesheet" href="app.css">
</head>
<body ng-cloak>
  <ul class="menu">
    <li><a href="#!/view1">view1</a></li>
    <li><a href="#!/view2">view2</a></li>
  </ul>

  <div ng-view></div>

  <div>AngularJS seed app: v<span app-version></span></div>

</body>
</html>


================================================
FILE: app/index.html
================================================
<!DOCTYPE html>
<!--[if lt IE 7]>      <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html lang="en" ng-app="myApp" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en" ng-app="myApp" class="no-js"> <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>My AngularJS App</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="lib/html5-boilerplate/dist/css/normalize.css">
  <link rel="stylesheet" href="lib/html5-boilerplate/dist/css/main.css">
  <link rel="stylesheet" href="app.css">
  <script src="lib/html5-boilerplate/dist/js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
  <ul class="menu">
    <li><a href="#!/view1">view1</a></li>
    <li><a href="#!/view2">view2</a></li>
  </ul>

  <!--[if lt IE 7]>
      <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
  <![endif]-->

  <div ng-view></div>

  <div>AngularJS seed app: v<span app-version></span></div>

  <!-- In production use:
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script>
  -->
  <script src="lib/angular/angular.js"></script>
  <script src="lib/angular-route/angular-route.js"></script>
  <script src="app.js"></script>
  <script src="view1/view1.js"></script>
  <script src="view2/view2.js"></script>
  <script src="core/version/version.js"></script>
  <script src="core/version/version-directive.js"></script>
  <script src="core/version/interpolate-filter.js"></script>
</body>
</html>


================================================
FILE: app/view1/view1.html
================================================
<p>This is the partial for view 1.</p>


================================================
FILE: app/view1/view1.js
================================================
'use strict';

angular.module('myApp.view1', ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/view1', {
    templateUrl: 'view1/view1.html',
    controller: 'View1Ctrl'
  });
}])

.controller('View1Ctrl', [function() {

}]);

================================================
FILE: app/view1/view1.spec.js
================================================
'use strict';

describe('myApp.view1 module', function() {

  beforeEach(module('myApp.view1'));

  describe('view1 controller', function(){

    it('should ....', inject(function($controller) {
      //spec body
      var view1Ctrl = $controller('View1Ctrl');
      expect(view1Ctrl).toBeDefined();
    }));

  });
});

================================================
FILE: app/view2/view2.html
================================================
<p>This is the partial for view 2.</p>
<p>
  Showing of 'interpolate' filter:
  {{ 'Current version is v%VERSION%.' | interpolate }}
</p>


================================================
FILE: app/view2/view2.js
================================================
'use strict';

angular.module('myApp.view2', ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/view2', {
    templateUrl: 'view2/view2.html',
    controller: 'View2Ctrl'
  });
}])

.controller('View2Ctrl', [function() {

}]);

================================================
FILE: app/view2/view2.spec.js
================================================
'use strict';

describe('myApp.view2 module', function() {

  beforeEach(module('myApp.view2'));

  describe('view2 controller', function(){

    it('should ....', inject(function($controller) {
      //spec body
      var view2Ctrl = $controller('View2Ctrl');
      expect(view2Ctrl).toBeDefined();
    }));

  });
});

================================================
FILE: e2e-tests/protractor.conf.js
================================================
//jshint strict: false
exports.config = {

  allScriptsTimeout: 11000,

  specs: [
    '*.js'
  ],

  capabilities: {
    browserName: 'chrome'
  },

  baseUrl: 'http://localhost:8000/',

  framework: 'jasmine',

  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }

};


================================================
FILE: e2e-tests/scenarios.js
================================================
'use strict';

/* https://github.com/angular/protractor/blob/master/docs/toc.md */

describe('my app', function() {


  it('should automatically redirect to /view1 when location hash/fragment is empty', function() {
    browser.get('index.html');
    expect(browser.getLocationAbsUrl()).toMatch("/view1");
  });


  describe('view1', function() {

    beforeEach(function() {
      browser.get('index.html#!/view1');
    });


    it('should render view1 when user navigates to /view1', function() {
      expect(element.all(by.css('[ng-view] p')).first().getText()).
        toMatch(/partial for view 1/);
    });

  });


  describe('view2', function() {

    beforeEach(function() {
      browser.get('index.html#!/view2');
    });


    it('should render view2 when user navigates to /view2', function() {
      expect(element.all(by.css('[ng-view] p')).first().getText()).
        toMatch(/partial for view 2/);
    });

  });
});


================================================
FILE: karma.conf.js
================================================
//jshint strict: false
module.exports = function(config) {
  config.set({

    basePath: './app',

    files: [
      'lib/angular/angular.js',
      'lib/angular-route/angular-route.js',
      '../node_modules/angular-mocks/angular-mocks.js',
      'core/**/*.js',
      'view*/**/*.js'
    ],

    autoWatch: true,

    frameworks: ['jasmine'],

    browsers: ['Chrome'],

    plugins: [
      'karma-chrome-launcher',
      'karma-firefox-launcher',
      'karma-jasmine'
    ]

  });
};


================================================
FILE: package.json
================================================
{
  "name": "angular-seed",
  "private": true,
  "version": "0.0.0",
  "description": "A starter project for AngularJS",
  "repository": "https://github.com/angular/angular-seed",
  "license": "MIT",
  "dependencies": {
    "angular": "^1.7.5",
    "angular-loader": "^1.7.5",
    "angular-route": "^1.7.5",
    "html5-boilerplate": "0.0.1"
  },
  "devDependencies": {
    "angular-mocks": "^1.7.5",
    "cpx": "^1.5.0",
    "http-server": "^0.11.1",
    "jasmine-core": "^3.3.0",
    "karma": "^3.1.1",
    "karma-chrome-launcher": "^2.2.0",
    "karma-firefox-launcher": "^1.1.0",
    "karma-jasmine": "^1.1.2",
    "protractor": "^5.4.1"
  },
  "scripts": {
    "postinstall": "npm run copy-libs",
    "update-deps": "npm update",
    "postupdate-deps": "npm run copy-libs",
    "copy-libs": "cpx \"node_modules/{angular,angular-*,html5-boilerplate/dist}/**/*\" app/lib -C",
    "prestart": "npm install",
    "start": "http-server -a localhost -p 8000 -c-1 ./app",
    "pretest": "npm install",
    "test": "karma start karma.conf.js",
    "test-single-run": "npm test -- --single-run",
    "preupdate-webdriver": "npm install",
    "//": "Do not install the Firefox driver to work around https://github.com/angular/webdriver-manager/issues/303.",
    "update-webdriver": "webdriver-manager update --gecko false",
    "preprotractor": "npm run update-webdriver",
    "protractor": "protractor e2e-tests/protractor.conf.js",
    "update-index-async": "node --eval \"var fs=require('fs'),indexFile='app/index-async.html',loaderFile='app/lib/angular-loader/angular-loader.min.js',loaderText=fs.readFileSync(loaderFile,'utf-8').split(/sourceMappingURL=angular-loader.min.js.map/).join('sourceMappingURL=lib/angular-loader/angular-loader.min.js.map'),indexText=fs.readFileSync(indexFile,'utf-8').split(/\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/).join('//@@NG_LOADER_START@@\\n'+loaderText+'    //@@NG_LOADER_END@@');fs.writeFileSync(indexFile,indexText);\""
  }
}
Download .txt
gitextract_z9fm4uis/

├── .gitignore
├── .jshintrc
├── .travis.yml
├── LICENSE
├── README.md
├── app/
│   ├── app.css
│   ├── app.js
│   ├── core/
│   │   └── version/
│   │       ├── interpolate-filter.js
│   │       ├── interpolate-filter.spec.js
│   │       ├── version-directive.js
│   │       ├── version-directive.spec.js
│   │       ├── version.js
│   │       └── version.spec.js
│   ├── index-async.html
│   ├── index.html
│   ├── view1/
│   │   ├── view1.html
│   │   ├── view1.js
│   │   └── view1.spec.js
│   └── view2/
│       ├── view2.html
│       ├── view2.js
│       └── view2.spec.js
├── e2e-tests/
│   ├── protractor.conf.js
│   └── scenarios.js
├── karma.conf.js
└── package.json
Condensed preview — 25 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (28K chars).
[
  {
    "path": ".gitignore",
    "chars": 59,
    "preview": "logs/*\n!.gitkeep\nnode_modules/\napp/lib/\ntmp\n.DS_Store\n.idea"
  },
  {
    "path": ".jshintrc",
    "chars": 377,
    "preview": "{\n  \"strict\": \"global\",\n  \"globals\": {\n    // AngularJS\n    \"angular\": false,\n\n    // AngularJS mocks\n    \"module\": fals"
  },
  {
    "path": ".travis.yml",
    "chars": 306,
    "preview": "dist: trusty\n\nlanguage: node_js\nnode_js:\n  - 10\n\naddons:\n  chrome: stable\n\ncache:\n  directories:\n    - \"$HOME/.npm\"\n\nins"
  },
  {
    "path": "LICENSE",
    "chars": 1100,
    "preview": "The MIT License\n\nCopyright (c) 2010-2016 Google, Inc. http://angularjs.org\n\nPermission is hereby granted, free of charge"
  },
  {
    "path": "README.md",
    "chars": 11781,
    "preview": "# `angular-seed` — the seed for AngularJS apps\n\nThis project is an application skeleton for a typical [AngularJS][angula"
  },
  {
    "path": "app/app.css",
    "chars": 306,
    "preview": "/* app css stylesheet */\n\n.menu {\n  list-style: none;\n  border-bottom: 0.1em solid black;\n  margin-bottom: 2em;\n  paddin"
  },
  {
    "path": "app/app.js",
    "chars": 370,
    "preview": "'use strict';\n\n// Declare app level module which depends on views, and core components\nangular.module('myApp', [\n  'ngRo"
  },
  {
    "path": "app/core/version/interpolate-filter.js",
    "chars": 221,
    "preview": "'use strict';\n\nangular.module('myApp.version.interpolate-filter', [])\n\n.filter('interpolate', ['version', function(versi"
  },
  {
    "path": "app/core/version/interpolate-filter.spec.js",
    "chars": 426,
    "preview": "'use strict';\n\ndescribe('myApp.version module', function() {\n  beforeEach(module('myApp.version'));\n\n  describe('interpo"
  },
  {
    "path": "app/core/version/version-directive.js",
    "chars": 199,
    "preview": "'use strict';\n\nangular.module('myApp.version.version-directive', [])\n\n.directive('appVersion', ['version', function(vers"
  },
  {
    "path": "app/core/version/version-directive.spec.js",
    "chars": 492,
    "preview": "'use strict';\n\ndescribe('myApp.version module', function() {\n  beforeEach(module('myApp.version'));\n\n  describe('app-ver"
  },
  {
    "path": "app/core/version/version.js",
    "chars": 153,
    "preview": "'use strict';\n\nangular.module('myApp.version', [\n  'myApp.version.interpolate-filter',\n  'myApp.version.version-directiv"
  },
  {
    "path": "app/core/version/version.spec.js",
    "chars": 268,
    "preview": "'use strict';\n\ndescribe('myApp.version module', function() {\n  beforeEach(module('myApp.version'));\n\n  describe('version"
  },
  {
    "path": "app/index-async.html",
    "chars": 2955,
    "preview": "<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <link rel=\"stylesheet\" href=\"lib/html5-boilerplate/di"
  },
  {
    "path": "app/index.html",
    "chars": 1860,
    "preview": "<!DOCTYPE html>\n<!--[if lt IE 7]>      <html lang=\"en\" ng-app=\"myApp\" class=\"no-js lt-ie9 lt-ie8 lt-ie7\"> <![endif]-->\n<"
  },
  {
    "path": "app/view1/view1.html",
    "chars": 39,
    "preview": "<p>This is the partial for view 1.</p>\n"
  },
  {
    "path": "app/view1/view1.js",
    "chars": 267,
    "preview": "'use strict';\n\nangular.module('myApp.view1', ['ngRoute'])\n\n.config(['$routeProvider', function($routeProvider) {\n  $rout"
  },
  {
    "path": "app/view1/view1.spec.js",
    "chars": 319,
    "preview": "'use strict';\n\ndescribe('myApp.view1 module', function() {\n\n  beforeEach(module('myApp.view1'));\n\n  describe('view1 cont"
  },
  {
    "path": "app/view2/view2.html",
    "chars": 138,
    "preview": "<p>This is the partial for view 2.</p>\n<p>\n  Showing of 'interpolate' filter:\n  {{ 'Current version is v%VERSION%.' | in"
  },
  {
    "path": "app/view2/view2.js",
    "chars": 267,
    "preview": "'use strict';\n\nangular.module('myApp.view2', ['ngRoute'])\n\n.config(['$routeProvider', function($routeProvider) {\n  $rout"
  },
  {
    "path": "app/view2/view2.spec.js",
    "chars": 319,
    "preview": "'use strict';\n\ndescribe('myApp.view2 module', function() {\n\n  beforeEach(module('myApp.view2'));\n\n  describe('view2 cont"
  },
  {
    "path": "e2e-tests/protractor.conf.js",
    "chars": 276,
    "preview": "//jshint strict: false\nexports.config = {\n\n  allScriptsTimeout: 11000,\n\n  specs: [\n    '*.js'\n  ],\n\n  capabilities: {\n  "
  },
  {
    "path": "e2e-tests/scenarios.js",
    "chars": 936,
    "preview": "'use strict';\n\n/* https://github.com/angular/protractor/blob/master/docs/toc.md */\n\ndescribe('my app', function() {\n\n\n  "
  },
  {
    "path": "karma.conf.js",
    "chars": 491,
    "preview": "//jshint strict: false\nmodule.exports = function(config) {\n  config.set({\n\n    basePath: './app',\n\n    files: [\n      'l"
  },
  {
    "path": "package.json",
    "chars": 1980,
    "preview": "{\n  \"name\": \"angular-seed\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"description\": \"A starter project for AngularJS\","
  }
]

About this extraction

This page contains the full source code of the angular/angular-seed GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 25 files (25.3 KB), approximately 7.2k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!