angular/angular.dart — pull request #348 by TedSander (2013-12-13 22:08:35+00:00)
Title: Template cache generator

Generates the template cache from angular source by looking at the NgComponent and NgTemplateCache annotations. Automatically adds css and html files from a component into the template cache as long as a NgTemplateCache annotation is not also present indicating the resource should not be cached. In addition any resources that are specified in the NgTemplateCache annotation will be cached as long as the cache value is true.

I'll add to the production tutorial next if this gets checked in.

Examples:

Creates a template_cache with the following assets: asset/template.html, and asset/style.css.
```dart
@NgComponent {
...
templateUrl: 'asset/template.html',
cssUrl: 'asset/style.css',
}
```

Assets asset/ignore_template.html, and asset/ignore_style.css will not be added to the template cache.
```dart
@NgComponent {
...
templateUrl: 'asset/ignore_template.html',
cssUrl: 'asset/ignore_style.css',
}
@NgTemplateCache {cache: false}
```

Will add the cach_template.html and cache_style.css to the template cache even though it is not used in a component. Useful for caching views.
```dart
@NgTemplateCache {
preCacheUrls: const [ 'cache_template.html', 'cache_style.css']
}
```

Usage:
```sh
template_cache_generator main.dart template_cache.dart .,packages/ ^package:,package/ LargeComponent
```
Will create a template_cache.dart file the component resources, and additional cache files specified in NgTemplateCache ignoring LargeComponent present in main.dart and all the source it relies on. Rewrites package: urls to package/ and looks in the current directory, and packages/ folder for source files.