Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
web-angular* template changes, prep for 1.0.21 (#365)
Browse files Browse the repository at this point in the history
* Move web-angular-quickstart to web-angular-simple
* Dynamically set base href in web-angular* templates
* Reduce differences between web-angular* templates
* Update CHANGELOG & web-angular description
  • Loading branch information
kwalrath authored Feb 18, 2017
1 parent ee3b4f6 commit d7e5166
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 54 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## 1.0.21
- Prefer using `analysis_options.yaml` files over `.analysis_options`.
- Added <base href="/"> to index.html in `web-angular`
- Changed the names of all `.analysis_options` files to `analysis_options.yaml`.
- In an effort to forestall routing issues during development, added code in
`web-angular*/web/index.html` to generate a base href.
- Renamed `web-angular-quickstart` to `web-angular-simple`.

## 1.0.20
- Updated `web-angular` to use `angular2_components` and to follow
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Kit and Yeoman.
* `console-simple` - A simple command-line application.
* `package-simple` - A starting point for Dart libraries or applications.
* `server-shelf` - A web server built using the shelf package.
* `web-angular` - A web app built using the latest version of Angular.
* `web-angular-quickstart` - A minimalist example app used in docs.
* `web-angular` - A web app built using the latest stable version of Angular.
* `web-angular-simple` - A minimalist example app used in docs.
* `web-simple` - An absolute bare-bones web app.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/web_angular.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'web_angular_data.dart';
class WebAngularGenerator extends DefaultGenerator {
WebAngularGenerator()
: super('web-angular', 'Angular Web Application',
'A web app built using the latest version of Angular.',
'A web app built using the latest stable version of Angular.',
categories: const ['dart', 'web']) {
for (TemplateFile file in decodeConcatenatedData(data)) {
addTemplateFile(file);
Expand Down
34 changes: 20 additions & 14 deletions lib/generators/web_angular_data.dart
Original file line number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cHQgZGVmZXIgc3JjPSJwYWNrYWdlcy9icm93c2VyL2Rh
cnQuanMiPjwvc2NyaXB0PgogICAgPGxpbmsgcmVsPSJzdHlsZXNoZWV0IiB0eXBlPSJ0ZXh0L2Nz
cyIgaHJlZj0iaHR0cHM6Ly9mb250cy5nb29nbGVhcGlzLmNvbS9pY29uP2ZhbWlseT1NYXRlcmlh
bCtJY29ucyI+CiAgICA8c3R5bGU+CiAgICAgIGJvZHkgewogICAgICAgIG1heC13aWR0aDogNjAw
cHg7CiAgICAgICAgbWFyZ2luOiAwIGF1dG87CiAgICAgICAgcGFkZGluZzogNXZ3OwogICAgICAg
IGZvbnQtZmFtaWx5OiBSb2JvdG8sIEhlbHZldGljYSwgQXJpYWwsIHNhbnMtc2VyaWY7CiAgICAg
IH0KICAgIDwvc3R5bGU+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPG15LWFwcD5Mb2FkaW5nLi4u
PC9teS1hcHA+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==""",
"web/main.dart",
"text",
"""Ly8gQ29weXJpZ2h0IChjKSBfX3llYXJfXywgX19hdXRob3JfXy4gQWxsIHJpZ2h0cyByZXNlcnZl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

import '../stagehand.dart';
import '../src/common.dart';
import 'web_angular_quickstart_data.dart';
import 'web_angular_simple_data.dart';

/**
* The QuickStart example used in AngularDart docs.
* The simple starter example used in AngularDart docs.
*/
class WebAngularQuickstartGenerator extends DefaultGenerator {
WebAngularQuickstartGenerator()
: super('web-angular-quickstart', 'Angular QuickStart Example',
class WebAngularSimpleGenerator extends DefaultGenerator {
WebAngularSimpleGenerator()
: super('web-angular-simple', 'Simple Angular Example',
'A minimalist example app used in docs.',
categories: const ['dart', 'web']) {
for (TemplateFile file in decodeConcatenatedData(data)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,22 @@ a2FnZTphbmd1bGFyMi9jb21tb24uZGFydCNDT01NT05f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
ICAgICAgICB2YXIgbWF0Y2ggPSBkb2N1bWVudC5sb2NhdGlvbi5wYXRobmFtZS5tYXRjaCgvXlwv
W19cd10rXC93ZWJcLy8pOwogICAgICAgICAgICB2YXIgaHJlZiA9IG1hdGNoID8gbWF0Y2hbMF0g
OiAnLyc7CiAgICAgICAgICAgIGRvY3VtZW50LndyaXRlKCc8YmFzZSBocmVmPSInICsgaHJlZiAr
ICciIC8+Jyk7CiAgICAgICAgfSgpKTsKICAgIDwvc2NyaXB0PgoKICAgIDx0aXRsZT5IZWxsbyBB
bmd1bGFyPC90aXRsZT4KICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4KICAgIDxtZXRhIG5hbWU9
InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsIGluaXRpYWwtc2NhbGU9MSI+
CiAgICA8bGluayByZWw9InN0eWxlc2hlZXQiIHR5cGU9InRleHQvY3NzIiBocmVmPSJzdHlsZXMu
Y3NzIj4KCiAgICA8c2NyaXB0IGRlZmVyIHNyYz0ibWFpbi5kYXJ0IiB0eXBlPSJhcHBsaWNhdGlv
bi9kYXJ0Ij48L3NjcmlwdD4KICAgIDxzY3JpcHQgZGVmZXIgc3JjPSJwYWNrYWdlcy9icm93c2Vy
L2RhcnQuanMiPjwvc2NyaXB0PgogIDwvaGVhZD4KICA8Ym9keT4KICAgIDxteS1hcHA+TG9hZGlu
Zy4uLjwvbXktYXBwPgogIDwvYm9keT4KPC9odG1sPgo=""",
"web/main.dart",
"text",
"""aW1wb3J0ICdwYWNrYWdlOmFuZ3VsYXIyL3BsYXRmb3JtL2Jyb3dzZXIuZGFydCc7CgppbXBvcnQg
Expand Down
4 changes: 2 additions & 2 deletions lib/stagehand.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import 'generators/console_simple.dart';
import 'generators/package_simple.dart';
import 'generators/server_shelf.dart';
import 'generators/web_angular.dart';
import 'generators/web_angular_quickstart.dart';
import 'generators/web_angular_simple.dart';
import 'generators/web_simple.dart';
import 'src/common.dart';

Expand All @@ -41,7 +41,7 @@ final List<Generator> generators = [
new PackageSimpleGenerator(),
new ServerShelfGenerator(),
new WebAngularGenerator(),
new WebAngularQuickstartGenerator(),
new WebAngularSimpleGenerator(),
new WebSimpleGenerator()
]..sort();

Expand Down
4 changes: 2 additions & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ <h1 id="usage">Usage</h1>
<li>console-simple - <em>A simple command-line application.</em></li>
<li>package-simple - <em>A starting point for Dart libraries or applications.</em></li>
<li>server-shelf - <em>A web server built using the shelf package.</em></li>
<li>web-angular - <em>A web app built using the latest version of Angular.</em></li>
<li>web-angular-quickstart - <em>A minimalist example app used in docs.</em></li>
<li>web-angular - <em>A web app built using the latest stable version of Angular.</em></li>
<li>web-angular-simple - <em>A minimalist example app used in docs.</em></li>
<li>web-simple - <em>An absolute bare-bones web app.</em></li>
</ul>

Expand Down
15 changes: 0 additions & 15 deletions templates/web-angular-quickstart/web/index.html

This file was deleted.

26 changes: 26 additions & 0 deletions templates/web-angular-simple/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<script>
// WARNING: DO NOT set the <base href> like this in production!
// Details: https://webdev.dartlang.org/angular/guide/router
(function () {
// App being served out of web folder (like WebStorm does)?
var match = document.location.pathname.match(/^\/[_\w]+\/web\//);
var href = match ? match[0] : '/';
document.write('<base href="' + href + '" />');
}());
</script>

<title>Hello Angular</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="styles.css">

<script defer src="main.dart" type="application/dart"></script>
<script defer src="packages/browser/dart.js"></script>
</head>
<body>
<my-app>Loading...</my-app>
</body>
</html>
14 changes: 11 additions & 3 deletions templates/web-angular/web/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<base href="/">
<!-- For testing in WebStorm use: -->
<!-- base href="/dart/web/" -->
<script>
// WARNING: DO NOT set the <base href> like this in production!
// Details: https://webdev.dartlang.org/angular/guide/router
(function () {
// App being served out of web folder (like WebStorm does)?
var match = document.location.pathname.match(/^\/[_\w]+\/web\//);
var href = match ? match[0] : '/';
document.write('<base href="' + href + '" />');
}());
</script>

<title>__projectName__</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down

0 comments on commit d7e5166

Please sign in to comment.