Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imtiaz #1

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.js linguist-language=typescript
*.css linguist-language=typescript
*.html linguist-language=typescript
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
npm-debug.log
.idea
.idea
*.js
*.map
6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

71 changes: 54 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
###这是n2-book配套源码,这个是本人在google上花了39美刀买的,贡献出来供大家使用。
###### 说明:由于目前ng2还处在beta版,更新的频率也比较快,有可以因为比较忙没有将最新的代码更新上来。请QQ联系我索取ng2相关资料

##### 为了方便大家使用和学习,本项目也附带上传了最新的电子书,有需要的请下载使用。
附带传送门[https://github.com/qq83387856/ng2-book-code/tree/master/%E7%94%B5%E5%AD%90%E4%B9%A6](https://github.com/qq83387856/ng2-book-code/tree/master/电子书)
######想要ng-book(1.5.x)源码请check。[传送门](https://github.com/qq83387856/ng-book-code/tree/master)
####### ng-book 英文原版(1.5.x)和中文版(1.2.x)本传送门 [https://github.com/qq83387856/ng-book-code/tree/master/pdf](https://github.com/qq83387856/ng-book-code/tree/master/pdf)

###下面就是官方对ng2-book的说明了,不关我啥事....

# ng-book 2: The Complete Guide to Angular 2 Sample Code

## Organization
Expand All @@ -20,15 +10,62 @@ It's organized by `chapter/topic`. Generally, in the book we call out where you

We're still unifying how each example should be run. Generally, you'll need to `npm install` and then see the `README.md` in each project for instructions to get the example going.

## THIS IS AN EARLY RELEASE
Nate, Felipe, and the ng-book 2 team

Angular 2 is still very young so some of the API is probably going to change. Also, we're still normalizing a build process for these examples, sorry for any clutter you might find.
We'll send you an email when we have updates available.
### if you feel it helpful for you, I hope that you can give a star. thank you!! also, there is a angular2-demo-project, if you need you can clone it. [angular2-demo](https://github.com/qq83387856/angular2-demo)
>PS: in order to convenient for we use or study, I should offer the pdf. but I can't. If you need it, please buy it at [https://www.ng-book.com/](https://www.ng-book.com/#packages)

## Feedback & Bug Reports
### 2、about ng1.5
* if you need ng-book(1.5) source code please click this. [address](https://github.com/AngularLovers/angularjs/tree/master)

We're currently developing the book and this code. If you have any feedback on things that aren't clear, or find any bugs just email us at: [email protected]
### 3、changeLog


| version |updated|comment|
|:----:|:----:|:----:|
| R27|2016-04-17|beta27|
| R30|2016-04-28|beta30|
| R33|2016-05-14|rc1|
| R34|2016-06-17|rc2|
| R35|2016-07-01|rc4|
| R37|2016-08-11|rc5|
| R39|2016-09-07|rc6|
| R40|2016-09-15|2.0.0|
| R42|2016-10-10|2.1.0|
| R43|2016-11-31|2.2.0|
| R45|2016-12-21|2.3.0-rc.0|
| R47|2017-01-11|2.4.1|
| R51|2017-02-14|2.4.7|
| R53|2017-03-07|2.4.8|
| R56|2017-03-27|2.4.10|



### 5、other
welcome to [xiaomo's blog](https://xiaomo.info).

[click to join us](http://jq.qq.com/?_wv=1027&k=29LUKS8)

if you have any questions, welcome new [issue](https://github.com/syoubaku/angular2/issues).

last, introduce a web site [angular.cn](http://angular.cn)


## 贡献者

感谢所有为本项目做出贡献的开发者们.
<a href="graphs/contributors"><img src="https://opencollective.com/angular2/contributors.svg?width=890" /></a>


## 支持者

感谢您的支持! 🙏 [[成为支持者](https://opencollective.com/angular2#backer)]

<a href="https://opencollective.com/angular2#backers" target="_blank"><img src="https://opencollective.com/angular2/backers.svg?width=890"></a>


## 赞助商

[[成为赞助商](https://opencollective.com/angular2#sponsor)]支持本项目并成为赞助商. 您的LOGO和网站链接将会被展示在这里.

Cheers!

Nate, Felipe, and the ng-book 2 team
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
58 changes: 58 additions & 0 deletions advanced-components/.angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "advanced-components"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"assets/vendor/semantic.min.css",
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}
13 changes: 13 additions & 0 deletions advanced-components/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
41 changes: 41 additions & 0 deletions advanced-components/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

#System Files
.DS_Store
Thumbs.db
38 changes: 38 additions & 0 deletions advanced-components/.test.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bats
DIR=$(dirname $BATS_TEST_FILENAME)

load "${NGBOOK_ROOT}/scripts/bats/fullstack.bats"
load "${NGBOOK_ROOT}/scripts/bats-support/load.bash"
load "${NGBOOK_ROOT}/scripts/bats-assert/load.bash"

# @test "advanced-components unit tests pass" {
# cd $DIR
# run ng test --single-run
# assert_output --partial 'SUCCESS'
# }

@test "advanced-components e2e tests pass" {
cd $DIR
run_ng_e2e $TEST_TMP_DIR
run cat ${TEST_TMP_DIR}/log.txt
assert_output --partial 'SUCCESS'
}

setup() {
echo "travis_fold:start:advanced-components-tests"
cd $DIR
TEST_TMP_DIR="$(mktemp -d -t fullstackXXX)"
kill_ng_cli || :
kill_by_port 4200
# ng serve 3>- &
true
}

teardown() {
cd $DIR
kill_ng_cli || :
# temp_del "$TEST_TMP_DIR"
kill_by_port 4200
echo "travis_fold:end:advanced-components-tests"
true
}
27 changes: 27 additions & 0 deletions advanced-components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# AdvancedComponents

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0-rc.1.

## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
35 changes: 35 additions & 0 deletions advanced-components/e2e/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { AdvancedComponentsPage } from './app.po';

describe('advanced-components App', () => {
let page: AdvancedComponentsPage;

beforeEach(() => {
page = new AdvancedComponentsPage();
});

it('should load the page', () => {
page.navigateTo();
expect(page.getHeaderText()).toEqual(`Angular 2 Advanced Components`);
expect(page.getIntroText()).toContain(`The ng-book team`);
});

it('should have tabs', () => {
page.navigateTo();
page.clickTab('Styling');
page.clickTab('Modifying the Host (Step 1)');
page.clickTab('Modifying the Host (Step 2)');
page.clickTab('Modifying the Host (Step 3)');
page.clickTab('Modifying the Host (Step 4)');
page.clickTab('Popup - Modifying the Host');
page.clickTab('Tabs - Component Querying');
page.clickTab('Lifecycle 1 - OnInit / OnDestroy');
page.clickTab('Lifecycle 2 - OnChanges');
page.clickTab('Lifecycle 3 - Differs');
page.clickTab('Lifecycle 4 - All Hooks');
page.clickTab('ngBookFor');
page.clickTab('ngBookIf');
page.clickTab('Content Projection');
page.clickTab('Change Detection - OnPush');
page.clickTab('Change Detection - Observables');
});
});
23 changes: 23 additions & 0 deletions advanced-components/e2e/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { browser, element, by } from 'protractor';

export class AdvancedComponentsPage {
navigateTo() {
return browser.get('/');
}

getParagraphText() {
return element(by.css('app-root h1')).getText();
}

getHeaderText() {
return element(by.css('h1.header')).getText();
}

getIntroText() {
return element(by.css('.intro')).getText();
}

clickTab(name) {
return element(by.cssContainingText('.menu a.item', name)).click();
}
}
19 changes: 19 additions & 0 deletions advanced-components/e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016"
],
"outDir": "../dist/out-tsc-e2e",
"module": "commonjs",
"target": "es6",
"types":[
"jasmine",
"node"
]
}
}
Loading