diff --git a/public/docs/_quickstart.jade b/public/docs/_quickstart.jade index d409ac8fea..9c78bbae6d 100644 --- a/public/docs/_quickstart.jade +++ b/public/docs/_quickstart.jade @@ -1,5 +1,136 @@ -if lang == 'js' - h2 I like JavaScript -else if lang == 'dart' - h2 I like Dart +//- if lang == 'js' +//- h2 I like JavaScript +//- else if lang == 'dart' +//- h2 I like Dart + +.content-block.content-number.clearfix + i.number.icon-number.large + + .c11 + header + + h3#section-install-angular Install Angular + p + | Install Angular from npm. + +.content-block.content-number.clearfix + i.number.icon-number2.large + + .c11 + header + + h3#section-transpile Transpile ES6 to ES5 + p + | Angular is written in ES6 which needs to be transpiled to ES5 before reaching the browser. + +.content-block.content-number.clearfix + i.number.icon-number3.large + + .c11 + header + + h3#section-transpile Import Angular + p + | Using the ES6 module syntax you can import Angular2. + pre + code + | import {Component, Template, bootstrap} from 'angular2/angular2'; + p + | The above import statement will import the three basic pieces needed to create an Angular app. + + +.content-block.content-number.clearfix + i.number.icon-number4.large + + .c11 + header + + h3#section-angular-create-account Create a component + p + | Angular is a component based framework. Components are used to structure and represent the UI. A Component is made up of two parts; the annotation section and the component controller. + pre + code + | import {Component, Template, bootstrap} from 'angular2/angular2'; + | @Component({ + | selector: 'app' + | }) + | @Template({ + | inline: ` + | <h1>Hello {{ name }}</h1> + | ` + | }) + | class AppComponent { + | constructor() { + | this.name = "Alice"; + | } + | } + | bootstrap(App); + + section.docs-sub-section + h4 Component Annotations + .c6 + p + | The annotation section is where you can describe meta-data about your + code component + | You can always identify an annotation by its + code @ + | sign. The Component annotation tells Angular what the HTML tag will be for your component. Whereas the Template annotations tells Angular what template to apply to your component. + pre + code + | @Component({ + | selector: 'app' + | }) + | @Template({ + | inline: ` + | <h1>Hello</h1> + | ` + | }) + p + | The Component created above will have a HTML tag of <app></app> and a template of <h1>Hello</h1>. + .clear + + section.docs-sub-section + h4 Component Controller + .c6 + p + | The component controller is defined using the ES6 class syntax. This class is the backing of the component's template. + pre + code + | class AppComponent { + | constructor() { + | this.name = "Alice"; + | } + | } + p + | In the template above binds to a name property through the {{ }} syntax. In the component's constructor the name property is being set to Alice. When the template is rendered, Alice will appear instead of {{ name }}. + p + | Templates read directly from their component controllers. Any properties or functions placed on the component controller can be directly accessed from the template. + .clear + +.content-block.content-number.clearfix + i.number.icon-number5.large + + .c11 + header + + h3#section-transpile Bootstrap + p + | The last step to get your component to load on the page. + + section.docs-sub-section + h4 The bootstrap function + .c6 + p + | Angular provides a bootstrap function that renders your component to the page. + .clear + +.content-block.content-number.clearfix + i.number.icon-number6.large + + .c11 + header + + h3#section-transpile Extra-credit + p + | Learn some template syntax for extra-credit. diff --git a/public/docs/index.jade b/public/docs/index.jade new file mode 100644 index 0000000000..bfb7ea1665 --- /dev/null +++ b/public/docs/index.jade @@ -0,0 +1,7 @@ + +section + h3 + a(href="/docs/js/quickstart") JavaScript Quickstart + + h3 + a(href="/docs/dart/quickstart") Dart Quickstart diff --git a/public/docs/index.md b/public/docs/index.md deleted file mode 100644 index 69e3544c68..0000000000 --- a/public/docs/index.md +++ /dev/null @@ -1 +0,0 @@ -#Docs home \ No newline at end of file