Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
chore(example): fix examples and cleanup
Browse files Browse the repository at this point in the history
* update pubspec
* ignore .pub folder at any level
* (form example): remove a reference to publishAs
* (animation example): Do not use shadow DOM
* (shadow dom example): use relative CSS urls
  • Loading branch information
vicb authored and rkirov committed Oct 17, 2014
1 parent a3ff5cf commit bf0aec4
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -19,5 +19,5 @@ docs.angulardart.org
dartdoc-viewer
docs
/e2e_bin
/.pub
.pub
*.orig
4 changes: 0 additions & 4 deletions example/pubspec.lock
Expand Up @@ -67,10 +67,6 @@ packages:
description: pool
source: hosted
version: "1.0.1"
quiver:
description: quiver
source: hosted
version: "0.18.2"
route_hierarchical:
description: route_hierarchical
source: hosted
Expand Down
1 change: 0 additions & 1 deletion example/pubspec.yaml
Expand Up @@ -4,7 +4,6 @@ dependencies:
angular:
path: ../
browser: any
quiver: '>=0.18.0<0.19.0'
unittest: any
web_components: any

Expand Down
1 change: 1 addition & 0 deletions example/web/animation/css_demo.dart
Expand Up @@ -2,6 +2,7 @@ part of animation;

@Component(
selector: 'css-demo',
useShadowDom: false,
template: '''
<div class="css-demo">
<button ng-click="stateA = !stateA"
Expand Down
1 change: 1 addition & 0 deletions example/web/animation/stress_demo.dart
Expand Up @@ -2,6 +2,7 @@ part of animation;

@Component(
selector: 'stress-demo',
useShadowDom: false,
template: '''
<div class="stress-demo">
<button ng-click="visible = !visible">
Expand Down
4 changes: 4 additions & 0 deletions example/web/css/shadow_dom_bracket.css
Expand Up @@ -2,4 +2,8 @@
:host {
border-top: 2px solid white;
border-bottom: 2px solid white;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
1 change: 0 additions & 1 deletion example/web/form.dart
Expand Up @@ -4,7 +4,6 @@ import 'package:angular/application_factory.dart';
@Component(
selector: '[form-controller]',
templateUrl: 'form_controller.html',
publishAs: 'form_ctrl',
useShadowDom: false)
class FormCtrl {
static const String _COLOR_HEX = "hex";
Expand Down
7 changes: 3 additions & 4 deletions example/web/maps.dart
Expand Up @@ -47,10 +47,9 @@ class XGoogleMaps implements ShadowRootAware {
}

main() {
var module = new Module()
..bind(XGoogleMaps);
var module = new Module()..bind(XGoogleMaps);

var injector = applicationFactory().addModule(module)
var injector = applicationFactory()
.addModule(module)
.run();
var scope = injector.get(Scope);
}
3 changes: 1 addition & 2 deletions example/web/paper.dart
Expand Up @@ -3,8 +3,7 @@ import 'package:angular/application_factory.dart';


main() {
var injector = applicationFactory()
.run();
var injector = applicationFactory().run();
var scope = injector.get(Scope);
scope.context['text'] = "Hello future";
scope.context['max'] = 20;
Expand Down
3 changes: 1 addition & 2 deletions example/web/paper_input.dart
Expand Up @@ -12,7 +12,6 @@ class PaperInputBindings {}

main() {
applicationFactory()
.addModule(new Module()
..bind(PaperInputBindings))
.addModule(new Module()..bind(PaperInputBindings))
.run();
}
18 changes: 8 additions & 10 deletions example/web/shadow_dom_components.dart
Expand Up @@ -4,8 +4,8 @@ import 'package:angular/application_factory.dart';
main() {
var app = applicationFactory();
app.modules.add(new Module()
..bind(MyComponent)
..bind(BracketButton));
..bind(MyComponent)
..bind(BracketButton));
app.selector("body");
app.run();
}
Expand All @@ -14,16 +14,14 @@ main() {
selector: "my-component",
template: """
<div class="custom-component" ng-class="color">
<span>Shadow [</span>
<content></content>
<span>]</span>
<a href="#" ng-click="on=!on"><my-button>
Toggle</my-button></a>
<span>Shadow [</span><content></content><span>]</span>
<a ng-click="on=!on">
<my-button>Toggle</my-button></a>
<span ng-if="on">off</span>
<span ng-if="!on">on</span>
</div>
""",
cssUrl: "/css/shadow_dom_components.css")
cssUrl: "css/shadow_dom_components.css")
class MyComponent {
@NgAttr('color')
String color;
Expand All @@ -35,6 +33,6 @@ class MyComponent {
selector: "my-button",
template: """<span class="custom-bracket">[[[<content>
</content>]]]</span>""",
cssUrl: "/css/shadow_dom_bracket.css")
cssUrl: "css/shadow_dom_bracket.css")
class BracketButton {
}
}
13 changes: 6 additions & 7 deletions example/web/shadow_dom_components.html
Expand Up @@ -27,24 +27,22 @@
<div class="content" ng-cloak>
<h1>Hi</h1>

<p>There should be <strong>three</strong> components here. One red,
one green, one blue:</p>
<p>There should be <strong>three</strong> components here. One red, one green, one blue:</p>

<my-component color="red">I'm a red component</my-component>
<my-component color="green">I'm a green component</my-component>
<my-component color="blue">I'm a blue component</my-component>

<br />
<my-component color="grey">I'm a
<span>content span</span></my-component>
<my-component color="grey">I'm a <span>content span</span></my-component>
<br />

<div class="red">I'm just a div with the <code>.red</code> class</div>
<div class="green">I'm just a div with the <code>.green</code> class</div>
<div class="blue">I'm just a div with the <code>.blue</code> class</div>
<br />
<h4>Nesting</h4>


<h4>Nesting</h4>
<my-component color="red">
<my-component color="green">
<my-component color="blue">
Expand All @@ -69,7 +67,8 @@ <h4>Nesting</h4>
</my-component>
</my-component>
</div>

<script type="application/dart" src="shadow_dom_components.dart"></script>
<script src="packages/browser/dart.js"></script>
</body>
</html>
</html>
2 changes: 0 additions & 2 deletions example/web/todo.dart
Expand Up @@ -6,8 +6,6 @@ import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';
import 'package:angular/playback/playback_http.dart';

import 'package:quiver/collection.dart';

class Item {
String text;
bool done;
Expand Down

0 comments on commit bf0aec4

Please sign in to comment.