Compare commits

..

10 Commits

Author SHA1 Message Date
47bc6f105d docs: add changelog for 5.0.0-rc.6 2017-10-25 14:34:42 -07:00
40fa2593a9 release: cut the 5.0.0-rc.6 release 2017-10-25 14:32:11 -07:00
680bcf7b8a build: update to rxjs@5.5.2 (#19931)
PR Close #19931
2017-10-25 15:32:01 -04:00
ef08330341 fix(compiler): automatically set emitDecoratorMetadata when "annotationsAs": "static fields” (#19927)
This is a workaround for https://github.com/angular/tsickle/issues/635.

Fixes #19916
PR Close #19927
2017-10-25 14:26:28 -04:00
6cc042e2ba fix(compiler-cli): produce correct paths for windows output (#19915)
The path mapping was broken for Windows by fc0b1d5b61.
Fixed the path mapping and put code in place to make such a problem
to sneek by again.

PR Close #19915
2017-10-24 19:21:18 -04:00
9b26455740 fix(compiler-cli): only use error collector when needed. (#19912)
The error collector changes behavior of the metadata resolver
in ways that haven't been fully hardened. This changes limits
its use to the lazy route detection and the language service.

Issue: #19906

PR Close #19912
2017-10-24 19:21:13 -04:00
18bce5987c fix(compiler): don’t type check templates with skipTemplateCodegen (#19909)
This change is needed to prevent users’ builds from breaking.

If a user sets `fullTemlateTypeCheck` to true, we will
continue to check the templates even when `skipTemplateCodegen` is true
as well.

Related to #19906

PR Close #19909
2017-10-24 19:21:03 -04:00
f1108fea76 docs: add changelog for 5.0.0-rc.5 2017-10-23 23:28:28 -07:00
64b3e3e41a release: cut the 5.0.0-rc.5 release 2017-10-23 23:27:15 -07:00
a82f863e24 fix(compiler-cli): report all diagnostic error messages (#19886)
This fixes a problem introduced in 8d45fefc31
which modified how diagnostic error messages are reported for structural
metadata errors causing some of the diagnostics to be lost.

PR Close #19886
2017-10-24 00:57:41 -04:00
2328 changed files with 28629 additions and 55029 deletions

18
.bazelrc Normal file
View File

@ -0,0 +1,18 @@
# Make compilation fast, by keeping a few copies of the compilers
# running as daemons, and cache SourceFile AST's to reduce parse time.
build --strategy=TypeScriptCompile=worker
build --strategy=AngularTemplateCompile=worker
# Don't create bazel-* symlinks in the WORKSPACE directory.
# These require .gitignore and may scare users.
# Also, it's a workaround for https://github.com/bazelbuild/rules_typescript/issues/12
# which affects the common case of having `tsconfig.json` in the WORKSPACE directory.
#
# Instead, you should run `bazel info bazel-bin` to find out where the outputs went.
build --symlink_prefix=/
# Performance: avoid stat'ing input files
build --watchfs
# Don't print all the .d.ts output locations after builds
build --show_result=0

View File

@ -7,25 +7,17 @@
# To validate changes, use an online parser, eg. # To validate changes, use an online parser, eg.
# http://yaml-online-parser.appspot.com/ # http://yaml-online-parser.appspot.com/
# Variables
## IMPORTANT
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
var_1: &docker_image angular/ngcontainer:0.1.0
var_2: &cache_key angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.1.0
# Settings common to each job # Settings common to each job
anchor_1: &job_defaults anchor_1: &job_defaults
working_directory: ~/ng working_directory: ~/ng
docker: docker:
- image: *docker_image - image: angular/ngcontainer:0.0.2
# After checkout, rebase on top of master. # After checkout, rebase on top of master.
# Similar to travis behavior, but not quite the same. # Similar to travis behavior, but not quite the same.
# See https://discuss.circleci.com/t/1662 # See https://discuss.circleci.com/t/1662
anchor_2: &post_checkout anchor_2: &post_checkout
post: git pull --ff-only origin "refs/pull/${CIRCLE_PULL_REQUEST//*pull\//}/merge" post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
version: 2 version: 2
jobs: jobs:
@ -34,38 +26,25 @@ jobs:
steps: steps:
- checkout: - checkout:
<<: *post_checkout <<: *post_checkout
# Check BUILD.bazel formatting before we have a node_modules directory
# Then we don't need any exclude pattern to avoid checking those files
- run: 'buildifier -mode=check $(find . -type f \( -name BUILD.bazel -or -name BUILD \)) ||
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
# Run the skylark linter to check our Bazel rules
- run: 'find . -type f -name "*.bzl" |
xargs java -jar /usr/local/bin/Skylint_deploy.jar ||
(echo -e "\n.bzl files have lint errors. Please run ''yarn skylint''"; exit 1)'
- restore_cache: - restore_cache:
key: *cache_key key: angular-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: yarn install --frozen-lockfile --non-interactive - run: yarn install --frozen-lockfile --non-interactive
- run: ./node_modules/.bin/gulp lint - run: ./node_modules/.bin/gulp lint
build: build:
<<: *job_defaults <<: *job_defaults
resource_class: large
steps: steps:
- checkout: - checkout:
<<: *post_checkout <<: *post_checkout
- restore_cache: - restore_cache:
key: *cache_key key: angular-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: bazel info release
- run: bazel run @yarn//:yarn - run: bazel run @yarn//:yarn
# Use bazel query so that we explicitly ask for all buildable targets to be built as well - run: bazel build packages/...
# This avoids waiting for a build command to finish before running the first test - run: bazel test @angular//...
# See https://github.com/bazelbuild/bazel/issues/4257
- run: bazel query --output=label '//modules/... union //packages/... union //tools/...' | xargs bazel test --config=ci
- save_cache: - save_cache:
key: *cache_key key: angular-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths: paths:
- "node_modules" - "node_modules"

View File

@ -1,68 +0,0 @@
# Configuration for angular-robot
# options for the merge plugin
merge:
# the status will be added to your pull requests
status:
# set to true to disable
disabled: false
# the name of the status
context: "ci/angular: merge status"
# text to show when all checks pass
successText: "All checks passed!"
# text to show when some checks are failing
failureText: "The following checks are failing:"
# comment that will be added to a PR when there is a conflict, leave empty or set to false to disable
mergeConflictComment: "Hi @{{PRAuthor}}! This PR has merge conflicts due to recent upstream merges.
\nPlease help to unblock it by resolving these conflicts. Thanks!"
# label to monitor
mergeLabel: "PR action: merge"
# list of checks that will determine if the merge label can be added
checks:
# whether the PR shouldn't have a conflict with the base branch
noConflict: true
# list of labels that a PR needs to have, checked with a regexp (e.g. "PR target:" will work for the label "PR target: master")
requiredLabels:
- "PR target:"
- "cla: yes"
# list of labels that a PR shouldn't have, checked after the required labels with a regexp
forbiddenLabels:
- "PR target: TBD"
- "PR action: cleanup"
- "cla: no"
# list of PR statuses that need to be successful
requiredStatuses:
- "continuous-integration/travis-ci/pr"
- "code-review/pullapprove"
- "ci/circleci: build"
- "ci/circleci: lint"
# the comment that will be added when the merge label is added despite failing checks, leave empty or set to false to disable
# {{MERGE_LABEL}} will be replaced by the value of the mergeLabel option
# {{PLACEHOLDER}} will be replaced by the list of failing checks
mergeRemovedComment: "I see that you just added the `{{MERGE_LABEL}}` label, but the following checks are still failing:
\n{{PLACEHOLDER}}
\n
\n**If you want your PR to be merged, it has to pass all the CI checks.**
\n
\nIf you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help."
# options for the triage plugin
triage:
# number of the milestone to apply when the issue is triaged
defaultMilestone: 82,
# arrays of labels that determine if an issue is triaged
triagedLabels:
-
- "type: bug"
- "severity"
- "freq"
- "comp:"
-
- "type: feature"
- "comp:"

2
.nvmrc
View File

@ -1 +1 @@
8.9 6.9.5

View File

@ -10,20 +10,23 @@
# brocco - Mike Brocchi # brocco - Mike Brocchi
# chuckjaz - Chuck Jazdzewski # chuckjaz - Chuck Jazdzewski
# filipesilva - Filipe Silva # filipesilva - Filipe Silva
# Foxandxss - Jesús Rodríguez
# gkalpak - George Kalpakas # gkalpak - George Kalpakas
# hansl - Hans Larsen # hansl - Hans Larsen
# IgorMinar - Igor Minar # IgorMinar - Igor Minar
# jasonaden - Jason Aden # jasonaden - Jason Aden
# kapunahelewong - Kapunahele Wong # juleskremer - Jules Kremer
# kara - Kara Erickson # kara - Kara Erickson
# matsko - Matias Niemelä # matsko - Matias Niemelä
# mhevery - Misko Hevery # mhevery - Misko Hevery
# petebacondarwin - Pete Bacon Darwin # petebacondarwin - Pete Bacon Darwin
# pkozlowski-opensource - Pawel Kozlowski # pkozlowski-opensource - Pawel Kozlowski
# robwormald - Rob Wormald # robwormald - Rob Wormald
# tbosch - Tobias Bosch
# tinayuangao - Tina Gao # tinayuangao - Tina Gao
# vicb - Victor Berchet # vicb - Victor Berchet
# vikerman - Vikram Subramanian # vikerman - Vikram Subramanian
# wardbell - Ward Bell
version: 2 version: 2
@ -34,33 +37,14 @@ group_defaults:
enabled: true enabled: true
approve_by_comment: approve_by_comment:
enabled: false enabled: false
# see http://docs.pullapprove.com/groups/author_approval/
author_approval:
# If the author is a reviewer on the PR, they will automatically have an "approved" status.
auto: true
groups: groups:
# Require all PRs to have at least one approval from *someone*
all:
users: all
required: 1
# In this group, your self-approval does not count
author_approval:
auto: false
ignored: true
files:
include:
- "*"
root: root:
conditions: conditions:
files: files:
include: include:
- "*" - "*"
exclude: exclude:
- "WORKSPACE"
- "BUILD.bazel"
- ".circleci/*"
- "aio/*" - "aio/*"
- "integration/*" - "integration/*"
- "modules/*" - "modules/*"
@ -87,12 +71,9 @@ groups:
- "*.bazel" - "*.bazel"
- "*.bzl" - "*.bzl"
- "packages/bazel/*" - "packages/bazel/*"
- "tools/bazel.rc"
users: users:
- alexeagle #primary - alexeagle #primary
- chuckjaz - chuckjaz
- IgorMinar #fallback
- mhevery
- vikerman #fallback - vikerman #fallback
build-and-ci: build-and-ci:
@ -104,7 +85,6 @@ groups:
- "*.lock" - "*.lock"
- "tools/*" - "tools/*"
exclude: exclude:
- "tools/bazel.rc"
- "tools/public_api_guard/*" - "tools/public_api_guard/*"
- "aio/*" - "aio/*"
users: users:
@ -120,6 +100,7 @@ groups:
users: users:
- alexeagle - alexeagle
- mhevery - mhevery
- tbosch
- vicb - vicb
- IgorMinar #fallback - IgorMinar #fallback
@ -128,9 +109,9 @@ groups:
files: files:
- "packages/core/*" - "packages/core/*"
users: users:
- mhevery #primary - tbosch #primary
- chuckjaz - chuckjaz
- kara - mhevery
- vicb - vicb
- IgorMinar #fallback - IgorMinar #fallback
@ -141,6 +122,7 @@ groups:
- "packages/platform-browser/animations/*" - "packages/platform-browser/animations/*"
users: users:
- matsko #primary - matsko #primary
- chuckjaz #fallback
- mhevery #fallback - mhevery #fallback
- IgorMinar #fallback - IgorMinar #fallback
@ -150,7 +132,7 @@ groups:
- "packages/compiler/src/i18n/*" - "packages/compiler/src/i18n/*"
users: users:
- vicb #primary - vicb #primary
- chuckjaz - tbosch
- IgorMinar #fallback - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
@ -159,8 +141,9 @@ groups:
files: files:
- "packages/compiler/*" - "packages/compiler/*"
users: users:
- chuckjaz #primary - tbosch #primary
- vicb - vicb
- chuckjaz
- mhevery - mhevery
- IgorMinar #fallback - IgorMinar #fallback
@ -172,7 +155,6 @@ groups:
- hansl - hansl
- filipesilva #fallback - filipesilva #fallback
- brocco #fallback - brocco #fallback
- IgorMinar #fallback
compiler-cli: compiler-cli:
conditions: conditions:
@ -186,6 +168,7 @@ groups:
- alexeagle - alexeagle
- chuckjaz - chuckjaz
- vicb - vicb
- tbosch
- IgorMinar #fallback - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
@ -218,8 +201,9 @@ groups:
- "packages/common/http/*" - "packages/common/http/*"
- "packages/http/*" - "packages/http/*"
users: users:
- alxhub #primary - vikerman #primary
- IgorMinar - alxhub
- IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
language-service: language-service:
@ -228,7 +212,7 @@ groups:
- "packages/language-service/*" - "packages/language-service/*"
users: users:
- chuckjaz #primary - chuckjaz #primary
# needs secondary - tbosch #secondary
- vicb - vicb
- IgorMinar #fallback - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
@ -238,7 +222,7 @@ groups:
files: files:
- "packages/router/*" - "packages/router/*"
users: users:
- jasonaden #primary - jasonaden
- vicb - vicb
- IgorMinar #fallback - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
@ -258,8 +242,8 @@ groups:
files: files:
- "packages/platform-browser/*" - "packages/platform-browser/*"
users: users:
- vicb #primary - tbosch #primary
# needs secondary - vicb #secondary
- IgorMinar #fallback - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
@ -269,8 +253,9 @@ groups:
- "packages/platform-server/*" - "packages/platform-server/*"
users: users:
- vikerman #primary - vikerman #primary
- alxhub #secondary - alxhub
- vicb - vicb
- tbosch
- IgorMinar #fallback - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
@ -280,7 +265,7 @@ groups:
- "packages/platform-webworker/*" - "packages/platform-webworker/*"
users: users:
- vicb #primary - vicb #primary
# needs secondary - tbosch #secondary
- IgorMinar #fallback - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
@ -299,7 +284,7 @@ groups:
files: files:
- "packages/benchpress/*" - "packages/benchpress/*"
users: users:
- alxhub # primary - tbosch #primary
# needs secondary # needs secondary
- IgorMinar #fallback - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
@ -327,11 +312,13 @@ groups:
- "aio/content/navigation.json" - "aio/content/navigation.json"
- "aio/content/license.md" - "aio/content/license.md"
users: users:
- kapunahelewong - juleskremer #primary
- Foxandxss
- stephenfluin - stephenfluin
- wardbell
- petebacondarwin - petebacondarwin
- gkalpak - gkalpak
- IgorMinar - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback
angular.io-marketing: angular.io-marketing:
@ -342,8 +329,9 @@ groups:
- "aio/content/navigation.json" - "aio/content/navigation.json"
- "aio/content/license.md" - "aio/content/license.md"
users: users:
- juleskremer #primary
- stephenfluin - stephenfluin
- petebacondarwin - petebacondarwin
- gkalpak - gkalpak
- IgorMinar - IgorMinar #fallback
- mhevery #fallback - mhevery #fallback

View File

@ -2,7 +2,7 @@ language: node_js
sudo: false sudo: false
dist: trusty dist: trusty
node_js: node_js:
- '8.9.1' - '6.9.5'
addons: addons:
# firefox: "38.0" # firefox: "38.0"

View File

@ -1,8 +1,5 @@
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
exports_files(["tsconfig.json"])
exports_files([
"tsconfig.json",
])
# This rule belongs in node_modules/BUILD # This rule belongs in node_modules/BUILD
# It's here as a workaround for # It's here as a workaround for
@ -14,25 +11,17 @@ filegroup(
# bazel query "deps(:node_modules)" | wc -l # bazel query "deps(:node_modules)" | wc -l
# This won't scale in the general case. # This won't scale in the general case.
# TODO(alexeagle): figure out what to do # TODO(alexeagle): figure out what to do
srcs = glob(["/".join([ srcs = glob(["/".join(["node_modules", pkg, "**", ext]) for pkg in [
"node_modules",
pkg,
"**",
ext,
]) for pkg in [
"jasmine", "jasmine",
"typescript", "typescript",
"zone.js", "zone.js",
"tsutils", "rxjs",
"@types/jasmine", "@types",
"@types/node",
"@types/source-map",
"tsickle", "tsickle",
"hammerjs", "hammerjs",
"protobufjs", "protobufjs",
"bytebuffer", "bytebuffer",
"reflect-metadata", "reflect-metadata",
"source-map-support",
"minimist", "minimist",
] for ext in [ ] for ext in [
"*.js", "*.js",
@ -40,26 +29,3 @@ filegroup(
"*.d.ts", "*.d.ts",
]]), ]]),
) )
filegroup(
name = "web_test_bootstrap_scripts",
# do not sort
srcs = [
"//:node_modules/reflect-metadata/Reflect.js",
"//:node_modules/zone.js/dist/zone.js",
"//:node_modules/zone.js/dist/async-test.js",
"//:node_modules/zone.js/dist/sync-test.js",
"//:node_modules/zone.js/dist/fake-async-test.js",
"//:node_modules/zone.js/dist/proxy.js",
"//:node_modules/zone.js/dist/jasmine-patch.js",
],
)
filegroup(
name = "angularjs",
# do not sort
srcs = [
"//:node_modules/angular/angular.js",
"//:node_modules/angular-mocks/angular-mocks.js",
],
)

File diff suppressed because it is too large Load Diff

View File

@ -69,22 +69,21 @@ You can file new issues by filling out our [new issue form](https://github.com/a
### <a name="submit-pr"></a> Submitting a Pull Request (PR) ### <a name="submit-pr"></a> Submitting a Pull Request (PR)
Before you submit your Pull Request (PR) consider the following guidelines: Before you submit your Pull Request (PR) consider the following guidelines:
1. Search [GitHub](https://github.com/angular/angular/pulls) for an open or closed PR * Search [GitHub](https://github.com/angular/angular/pulls) for an open or closed PR
that relates to your submission. You don't want to duplicate effort. that relates to your submission. You don't want to duplicate effort.
1. Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs. * Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
We cannot accept code without this. We cannot accept code without this.
1. Fork the angular/angular repo. * Make your changes in a new git branch:
1. Make your changes in a new git branch:
```shell ```shell
git checkout -b my-fix-branch master git checkout -b my-fix-branch master
``` ```
1. Create your patch, **including appropriate test cases**. * Create your patch, **including appropriate test cases**.
1. Follow our [Coding Rules](#rules). * Follow our [Coding Rules](#rules).
1. Run the full Angular test suite, as described in the [developer documentation][dev-doc], * Run the full Angular test suite, as described in the [developer documentation][dev-doc],
and ensure that all tests pass. and ensure that all tests pass.
1. Commit your changes using a descriptive commit message that follows our * Commit your changes using a descriptive commit message that follows our
[commit message conventions](#commit). Adherence to these conventions [commit message conventions](#commit). Adherence to these conventions
is necessary because release notes are automatically generated from these messages. is necessary because release notes are automatically generated from these messages.
@ -93,13 +92,13 @@ Before you submit your Pull Request (PR) consider the following guidelines:
``` ```
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files. Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
1. Push your branch to GitHub: * Push your branch to GitHub:
```shell ```shell
git push origin my-fix-branch git push origin my-fix-branch
``` ```
1. In GitHub, send a pull request to `angular:master`. * In GitHub, send a pull request to `angular:master`.
* If we suggest changes then: * If we suggest changes then:
* Make the required updates. * Make the required updates.
* Re-run the Angular test suites to ensure tests are still passing. * Re-run the Angular test suites to ensure tests are still passing.

View File

@ -1,6 +1,6 @@
The MIT License The MIT License
Copyright (c) 2014-2018 Google, Inc. http://angular.io Copyright (c) 2014-2017 Google, Inc. http://angular.io
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -2,6 +2,8 @@
[![CircleCI](https://circleci.com/gh/angular/angular/tree/master.svg?style=shield)](https://circleci.com/gh/angular/angular/tree/master) [![CircleCI](https://circleci.com/gh/angular/angular/tree/master.svg?style=shield)](https://circleci.com/gh/angular/angular/tree/master)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06)](https://www.browserstack.com/automate/public-build/LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06)](https://www.browserstack.com/automate/public-build/LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06)
[![Join the chat at https://gitter.im/angular/angular](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the chat at https://gitter.im/angular/angular](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Issue Stats](http://issuestats.com/github/angular/angular/badge/pr?style=flat)](http://issuestats.com/github/angular/angular)
[![Issue Stats](http://issuestats.com/github/angular/angular/badge/issue?style=flat)](http://issuestats.com/github/angular/angular)
[![npm version](https://badge.fury.io/js/%40angular%2Fcore.svg)](https://www.npmjs.com/@angular/core) [![npm version](https://badge.fury.io/js/%40angular%2Fcore.svg)](https://www.npmjs.com/@angular/core)

View File

@ -1,58 +1,24 @@
workspace(name = "angular") workspace(name = "angular_src")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository( git_repository(
name = "build_bazel_rules_nodejs", name = "build_bazel_rules_nodejs",
remote = "https://github.com/bazelbuild/rules_nodejs.git", remote = "https://github.com/bazelbuild/rules_nodejs.git",
tag = "0.3.1", # TODO(alexeagle): use the correct tag here.
commit = "2c6243df53fd33fdab283ebdd01582e4eb815db8",
) )
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories") load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
check_bazel_version("0.9.0")
node_repositories(package_json = ["//:package.json"]) node_repositories(package_json = ["//:package.json"])
git_repository( local_repository(
name = "build_bazel_rules_typescript", name = "build_bazel_rules_typescript",
remote = "https://github.com/bazelbuild/rules_typescript.git", path = "node_modules/@bazel/typescript",
commit = "c4ea003acd7d42269b81a2d25eb832972cd24912"
) )
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
ts_setup_workspace()
local_repository( local_repository(
name = "rxjs", name = "angular",
path = "node_modules/rxjs/src", path = "packages/bazel",
)
git_repository(
name = "com_github_bazelbuild_buildtools",
remote = "https://github.com/bazelbuild/buildtools.git",
# Note, this commit matches the version of buildifier in angular/ngcontainer
# If you change this, also check if it matches the version in the angular/ngcontainer
# version in /.circleci/config.yml
commit = "b3b620e8bcff18ed3378cd3f35ebeb7016d71f71",
)
http_archive(
name = "io_bazel_rules_go",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.7.1/rules_go-0.7.1.tar.gz",
sha256 = "341d5eacef704415386974bc82a1783a8b7ffbff2ab6ba02375e1ca20d9b031c",
)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
# Fetching the Bazel source code allows us to compile the Skylark linter
http_archive(
name = "io_bazel",
url = "https://github.com/bazelbuild/bazel/archive/9755c72b48866ed034bd28aa033e9abd27431b1e.zip",
strip_prefix = "bazel-9755c72b48866ed034bd28aa033e9abd27431b1e",
sha256 = "5b8443fc3481b5fcd9e7f348e1dd93c1397f78b223623c39eb56494c55f41962",
) )

View File

@ -62,9 +62,6 @@
"styleExt": "scss", "styleExt": "scss",
"component": { "component": {
"inlineStyle": true "inlineStyle": true
},
"build": {
"namedChunks": true
} }
} }
} }

View File

@ -4,7 +4,7 @@ Everything in this folder is part of the documentation project. This includes
* the web site for displaying the documentation * the web site for displaying the documentation
* the dgeni configuration for converting source files to rendered files that can be viewed in the web site. * the dgeni configuration for converting source files to rendered files that can be viewed in the web site.
* the tooling for setting up examples for development; and generating live-example and zip files from the examples. * the tooling for setting up examples for development; and generating plunkers and zip files from the examples.
## Developer tasks ## Developer tasks
@ -13,7 +13,7 @@ You should run all these tasks from the `angular/aio` folder.
Here are the most important tasks you might need to use: Here are the most important tasks you might need to use:
* `yarn` - install all the dependencies. * `yarn` - install all the dependencies.
* `yarn setup` - install all the dependencies, boilerplate, stackblitz, zips and run dgeni on the docs. * `yarn setup` - install all the dependencies, boilerplate, plunkers, zips and run dgeni on the docs.
* `yarn setup-local` - same as `setup`, but use the locally built Angular packages for aio and docs examples boilerplate. * `yarn setup-local` - same as `setup`, but use the locally built Angular packages for aio and docs examples boilerplate.
* `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc). * `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc).
@ -32,7 +32,7 @@ Here are the most important tasks you might need to use:
* `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally. Add the option `--local` to use your local version of Angular contained in the "dist" folder. * `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally. Add the option `--local` to use your local version of Angular contained in the "dist" folder.
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`. * `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
* `yarn generate-stackblitz` - generate the stackblitz files that are used by the `live-example` tags in the docs. * `yarn generate-plunkers` - generate the plunker files that are used by the `live-example` tags in the docs.
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs. * `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
* `yarn example-e2e` - run all e2e tests for examples * `yarn example-e2e` - run all e2e tests for examples
@ -68,11 +68,6 @@ The content is written in markdown.
All other content is written using markdown in text files, located in the `angular/aio/content` folder. All other content is written using markdown in text files, located in the `angular/aio/content` folder.
More specifically, there are sub-folders that contain particular types of content: guides, tutorial and marketing. More specifically, there are sub-folders that contain particular types of content: guides, tutorial and marketing.
* **Code examples**: code examples need to be testable to ensure their accuracy.
Also, our examples have a specific look and feel and allow the user to copy the source code. For larger
examples they are rendered in a tabbed interface (e.g. template, HTML, and TypeScript on separate
tabs). Additionally, some are live examples, which provide links where the code can be edited, executed, and/or downloaded. For details on working with code examples, please read the [Code snippets](https://angular.io/guide/docs-style-guide#code-snippets), [Source code markup](https://angular.io/guide/docs-style-guide#source-code-markup), and [Live examples](https://angular.io/guide/docs-style-guide#live-examples) pages of the [Authors Style Guide](https://angular.io/guide/docs-style-guide).
We use the [dgeni](https://github.com/angular/dgeni) tool to convert these files into docs that can be viewed in the doc-viewer. We use the [dgeni](https://github.com/angular/dgeni) tool to convert these files into docs that can be viewed in the doc-viewer.
The [Authors Style Guide](https://angular.io/guide/docs-style-guide) prescribes guidelines for The [Authors Style Guide](https://angular.io/guide/docs-style-guide) prescribes guidelines for

View File

@ -74,10 +74,11 @@ aot-compiler/**/*.factory.d.ts
!styleguide/src/systemjs.custom.js !styleguide/src/systemjs.custom.js
# universal # universal
!universal/webpack.server.config.js !universal/webpack.config.client.js
!universal/webpack.config.universal.js
# stackblitz # plunkers
*stackblitz.no-link.html *plnkr.no-link.html
# ngUpgrade testing # ngUpgrade testing
!upgrade-phonecat-*/**/karma.conf.js !upgrade-phonecat-*/**/karma.conf.js

View File

@ -1,62 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "angular.io-example"
},
"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",
// #docregion styles
"styles": [
"styles.css"
],
// #enddocregion styles
"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",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}

View File

@ -1,5 +1,6 @@
{ {
"description": "AngularJS to Angular Quick Reference", "description": "AngularJS to Angular Quick Reference",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",

View File

@ -5,6 +5,9 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>AngularJS to Angular Quick Reference</title> <title>AngularJS to Angular Quick Reference</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- #docregion style -->
<link rel="stylesheet" href="styles.css">
<!-- #enddocregion style -->
</head> </head>
<body> <body>

View File

@ -1,5 +1,6 @@
{ {
"description": "Angular Animations", "description": "Angular Animations",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js" "!**/*.js"

View File

@ -0,0 +1,27 @@
'use strict'; // necessary for es6 output in node
import { browser, element, by } from 'protractor';
/* tslint:disable:quotemark */
describe('AOT Compilation', function () {
beforeAll(function () {
browser.get('');
});
it('should load page and click button', function (done: any) {
let headingSelector = element.all(by.css('h1')).get(0);
expect(headingSelector.getText()).toEqual('Hello Angular');
expect(element.all(by.xpath('//div[text()="Magneta"]')).get(0).isPresent()).toBe(true);
expect(element.all(by.xpath('//div[text()="Bombasto"]')).get(0).isPresent()).toBe(true);
expect(element.all(by.xpath('//div[text()="Magma"]')).get(0).isPresent()).toBe(true);
expect(element.all(by.xpath('//div[text()="Tornado"]')).get(0).isPresent()).toBe(true);
let toggleButton = element.all(by.css('button')).get(0);
toggleButton.click().then(function() {
expect(headingSelector.isPresent()).toBe(false);
done();
});
});
});

View File

@ -0,0 +1,4 @@
{
"build": "build:aot",
"projectType": "systemjs"
}

View File

@ -0,0 +1,33 @@
// #docregion
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify';
// #docregion config
export default {
entry: 'src/main.js',
dest: 'src/build.js', // output a single application bundle
sourceMap: true,
format: 'iife',
onwarn: function(warning) {
// Skip certain warnings
// should intercept ... but doesn't in some rollup versions
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
// console.warn everything else
console.warn( warning.message );
},
plugins: [
nodeResolve({jsnext: true, module: true}),
// #docregion commonjs
commonjs({
include: 'node_modules/rxjs/**',
}),
// #enddocregion commonjs
// #docregion uglify
uglify()
// #enddocregion uglify
]
};
// #enddocregion config

View File

@ -0,0 +1,7 @@
<!-- #docregion -->
<button (click)="toggleHeading()">Toggle Heading</button>
<h1 *ngIf="showHeading">Hello Angular</h1>
<h3>List of Heroes</h3>
<div *ngFor="let hero of heroes">{{hero}}</div>

View File

@ -0,0 +1,15 @@
// #docregion
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html'
})
export class AppComponent {
showHeading = true;
heroes = ['Magneta', 'Bombasto', 'Magma', 'Tornado'];
toggleHeading() {
this.showHeading = !this.showHeading;
}
}

View File

@ -1,12 +1,11 @@
// #docregion
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component.0'; import { AppComponent } from './app.component';
@NgModule({ @NgModule({
// #docregion imports
imports: [ BrowserModule ], imports: [ BrowserModule ],
// #enddocregion imports
declarations: [ AppComponent ], declarations: [ AppComponent ],
bootstrap: [ AppComponent ] bootstrap: [ AppComponent ]
}) })

View File

@ -0,0 +1,24 @@
<!-- #docregion -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Ahead of time compilation (JIT)</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<!-- #docregion jit -->
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('main-jit.js').catch(function(err){ console.error(err); });
</script>
<!-- #enddocregion jit -->
</head>
<body>
<my-app>Loading...</my-app>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!-- #docregion -->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Ahead of time compilation</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
</head>
<body>
<my-app>Loading...</my-app>
</body>
<!-- #docregion bundle -->
<script src="build.js"></script>
<!-- #enddocregion bundle -->
</html>

View File

@ -0,0 +1,6 @@
// #docregion
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
console.log('Running JIT compiled');
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -0,0 +1,6 @@
// #docregion
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from './app/app.module.ngfactory';
console.log('Running AOT compiled');
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);

View File

@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es2015", "dom"],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"./node_modules/@types/"
]
},
"files": [
"src/app/app.module.ts",
"src/main.ts"
],
"angularCompilerOptions": {
"annotationsAs": "decorators",
"genDir": ".",
"skipMetadataEmit" : true
}
}

View File

@ -1,9 +1,9 @@
{ {
"description": "Intro to Angular", "description": "Intro to Angular",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",
"!**/*.[1].*" "!app/hero-list.component.1.*"
], ]
"file": "src/app/app.module.ts"
} }

View File

@ -1,10 +1,9 @@
<hr> <hr>
<h4>{{hero.name}} Detail</h4> <h4>{{hero.name}} Detail</h4>
<div>Id: {{hero.id}}</div> <div>Id: {{hero.id}}</div>
<label>Name: <div>Name:
<!-- #docregion ngModel --> <!-- #docregion ngModel -->
<input [(ngModel)]="hero.name"> <input [(ngModel)]="hero.name">
<!-- #enddocregion ngModel --> <!-- #enddocregion ngModel -->
</label> </div>
<br /> <div>Power:<input [(ngModel)]="hero.power"></div>
<label>Power: <input [(ngModel)]="hero.power"></label>

View File

@ -7,7 +7,7 @@ import { TaxRateService } from './tax-rate.service';
selector: 'app-sales-tax', selector: 'app-sales-tax',
template: ` template: `
<h2>Sales Tax Calculator</h2> <h2>Sales Tax Calculator</h2>
<label>Amount: <input #amountBox (change)="0"></label> Amount: <input #amountBox (change)="0">
<div *ngIf="amountBox.value"> <div *ngIf="amountBox.value">
The sales tax is The sales tax is

View File

@ -1,9 +1,10 @@
{ {
"description": "Attribute Directive", "description": "Attribute Directive",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",
"!**/*.[1,2,3].*" "!app/*.[1,2,3].*"
], ],
"tags": ["attribute", "directive"] "tags": ["attribute", "directive"]
} }

View File

@ -1,14 +1,14 @@
<!-- #docregion --> <!-- #docregion -->
<h1>My First Attribute Directive</h1> <h1>My First Attribute Directive</h1>
<!-- #docregion applied --> <!-- #docregion applied -->
<p appHighlight>Highlight me!</p> <p appHightlight>Highlight me!</p>
<!-- #enddocregion applied, --> <!-- #enddocregion applied, -->
<!-- #docregion color-1 --> <!-- #docregion color-1 -->
<p appHighlight highlightColor="yellow">Highlighted in yellow</p> <p appHightlight highlightColor="yellow">Highlighted in yellow</p>
<p appHighlight [highlightColor]="'orange'">Highlighted in orange</p> <p appHightlight [highlightColor]="'orange'">Highlighted in orange</p>
<!-- #enddocregion color-1 --> <!-- #enddocregion color-1 -->
<!-- #docregion color-2 --> <!-- #docregion color-2 -->
<p appHighlight [highlightColor]="color">Highlighted with parent component's color</p> <p appHightlight [highlightColor]="color">Highlighted with parent component's color</p>
<!-- #enddocregion color-2 --> <!-- #enddocregion color-2 -->

View File

@ -1,4 +1,4 @@
// Not used. Keep away from stackblitz // Not used. Keep away from plunker
// Keeps ATLS from complaining about undeclared directives. // Keeps ATLS from complaining about undeclared directives.
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';

View File

@ -1,9 +0,0 @@
// #docregion
import { Directive } from '@angular/core';
@Directive({
selector: '[appHighlight]'
})
export class HighlightDirective {
constructor() { }
}

View File

@ -1,10 +1,8 @@
/* tslint:disable:no-unused-variable */ /* tslint:disable:no-unused-variable */
// #docregion // #docregion
import { Directive, ElementRef } from '@angular/core'; import { Directive, ElementRef, Input } from '@angular/core';
@Directive({ @Directive({ selector: '[appHighlight]' })
selector: '[appHighlight]'
})
export class HighlightDirective { export class HighlightDirective {
constructor(el: ElementRef) { constructor(el: ElementRef) {
el.nativeElement.style.backgroundColor = 'yellow'; el.nativeElement.style.backgroundColor = 'yellow';

View File

@ -1,10 +1,7 @@
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
// #docplaster // #docplaster
// #docregion imports,
import { Directive, ElementRef, HostListener } from '@angular/core';
// #enddocregion imports,
import { Input } from '@angular/core';
// #docregion // #docregion
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
@Directive({ @Directive({
selector: '[appHighlight]' selector: '[appHighlight]'
@ -38,7 +35,7 @@ export class HighlightDirective {
// #enddocregion color // #enddocregion color
// #docregion color-2 // #docregion color-2
@Input() appHighlight: string; @Input() myHighlight: string;
// #enddocregion color-2 // #enddocregion color-2
} }

View File

@ -1,7 +1,6 @@
/* tslint:disable:member-ordering */ /* tslint:disable:member-ordering */
// #docregion, imports // #docregion
import { Directive, ElementRef, HostListener, Input } from '@angular/core'; import { Directive, ElementRef, HostListener, Input } from '@angular/core';
// #enddocregion imports
@Directive({ @Directive({
selector: '[appHighlight]' selector: '[appHighlight]'

View File

@ -1,5 +1,7 @@
/* tslint:disable:member-ordering */ /* tslint:disable:member-ordering */
// #docregion imports,
import { Directive, ElementRef, HostListener, Input } from '@angular/core'; import { Directive, ElementRef, HostListener, Input } from '@angular/core';
// #enddocregion imports
@Directive({ @Directive({
selector: '[appHighlight]' selector: '[appHighlight]'

View File

@ -1,8 +0,0 @@
{
"server": {
"baseDir": "src",
"routes": {
"/node_modules": "node_modules"
}
}
}

View File

@ -1,14 +0,0 @@
import { AppPage } from './app.po';
describe('feature-modules App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('app works!');
});
});

View File

@ -1,3 +0,0 @@
<h1>
{{title}}
</h1>

View File

@ -1,32 +0,0 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
});
TestBed.compileComponents();
});
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('app works!');
}));
});

View File

@ -1,10 +0,0 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
}

View File

@ -1,34 +0,0 @@
// #docplaster
// #docregion whole-ngmodule
// imports
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
// #docregion directive-import
import { ItemDirective } from './item.directive';
// #enddocregion directive-import
// @NgModule decorator with its metadata
@NgModule({
// #docregion declarations
declarations: [
AppComponent,
ItemDirective
],
// #enddocregion declarations
imports: [
BrowserModule,
FormsModule,
HttpModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
// #enddocregion whole-ngmodule

View File

@ -1,8 +0,0 @@
import { ItemDirective } from './item.directive';
describe('ItemDirective', () => {
it('should create an instance', () => {
const directive = new ItemDirective();
expect(directive).toBeTruthy();
});
});

View File

@ -1,15 +0,0 @@
// #docplaster
// #docregion directive
import { Directive } from '@angular/core';
@Directive({
selector: '[appItem]'
})
export class ItemDirective {
// code goes here
constructor() { }
}
// #enddocregion directive

View File

@ -1,14 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>NgmoduleDemo</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>

View File

@ -1,10 +0,0 @@
{
"description": "Bootstrapping",
"files": [
"!**/*.d.ts",
"!**/*.js",
"!**/*.[1,2].*"
],
"file": "src/app/app.component.ts",
"tags": ["ngmodules"]
}

View File

@ -1,5 +1,6 @@
{ {
"description": "Component Communication Cookbook samples", "description": "Component Communication Cookbook samples",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js" "!**/*.js"

View File

@ -13,7 +13,7 @@ describe('Component Style Tests', function () {
let externalH1 = element(by.css('body > h1')); let externalH1 = element(by.css('body > h1'));
// Note: sometimes webdriver returns the fontWeight as "normal", // Note: sometimes webdriver returns the fontWeight as "normal",
// other times as "400", both of which are equal in CSS terms. // othertimes as "400", both of which are equal in CSS terms.
expect(componentH1.getCssValue('fontWeight')).toMatch(/normal|400/); expect(componentH1.getCssValue('fontWeight')).toMatch(/normal|400/);
expect(externalH1.getCssValue('fontWeight')).not.toMatch(/normal|400/); expect(externalH1.getCssValue('fontWeight')).not.toMatch(/normal|400/);
}); });

View File

@ -1,10 +1,10 @@
{ {
"description": "Component Styles", "description": "Component Styles",
"basePath": "src/",
"files": [ "files": [
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",
"!**/*.native.*", "!**/*.native.*"
"!**/*.[1].*"
], ],
"tags": ["CSS"] "tags": ["CSS"]
} }

View File

@ -1,3 +0,0 @@
h1 {
font-weight: normal;
}

View File

@ -1,25 +0,0 @@
import { Component, HostBinding } from '@angular/core';
import { Hero } from './hero';
// #docregion
@Component({
selector: 'app-root',
template: `
<h1>Tour of Heroes</h1>
<app-hero-main [hero]="hero"></app-hero-main>
`,
styleUrls: ['./hero-app.component.css']
})
export class HeroAppComponent {
// #enddocregion
hero = new Hero(
'Human Torch',
['Mister Fantastic', 'Invisible Woman', 'Thing']
);
@HostBinding('class') get themeClass() {
return 'theme-light';
}
// #docregion
}
// #enddocregion

View File

@ -6,8 +6,7 @@ import { Hero } from './hero';
selector: 'app-root', selector: 'app-root',
template: ` template: `
<h1>Tour of Heroes</h1> <h1>Tour of Heroes</h1>
<app-hero-main [hero]="hero"></app-hero-main> <app-hero-main [hero]=hero></app-hero-main>`,
`,
styles: ['h1 { font-weight: normal; }'] styles: ['h1 { font-weight: normal; }']
}) })
export class HeroAppComponent { export class HeroAppComponent {

View File

@ -1,5 +1,6 @@
{ {
"description": "Dependency Injection", "description": "Dependency Injection",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",

View File

@ -1,10 +1,10 @@
{ {
"description": "Dependency Injection", "description": "Dependency Injection",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",
"!**/*.[0,1,2].*", "!**/*.[1,2].*"
"!**/dummy.module.ts"
], ],
"tags": ["dependency", "di"] "tags": ["dependency", "di"]
} }

View File

@ -1,10 +0,0 @@
/*
Must put this interface in its own file instead of app.config.ts
or else TypeScript gives a (bogus) warning:
WARNING in ./src/app/... .ts
"export 'AppConfig' was not found in './app.config'
*/
export interface AppConfig {
apiEndpoint: string;
title: string;
}

View File

@ -1,3 +1,5 @@
// Early versions
// #docregion // #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';

View File

@ -1,6 +1,7 @@
// #docregion // #docregion
// #docregion imports // #docregion imports
import { Component, Inject } from '@angular/core'; import { Component } from '@angular/core';
import { Inject } from '@angular/core';
import { APP_CONFIG, AppConfig } from './app.config'; import { APP_CONFIG, AppConfig } from './app.config';
// #enddocregion imports // #enddocregion imports
@ -22,5 +23,3 @@ export class AppComponent {
} }
// #enddocregion ctor // #enddocregion ctor
} }
// #enddocregion

View File

@ -4,6 +4,7 @@
import { Component, Inject } from '@angular/core'; import { Component, Inject } from '@angular/core';
import { APP_CONFIG, AppConfig } from './app.config'; import { APP_CONFIG, AppConfig } from './app.config';
import { Logger } from './logger.service';
import { UserService } from './user.service'; import { UserService } from './user.service';
// #enddocregion imports // #enddocregion imports
@ -22,7 +23,8 @@ import { UserService } from './user.service';
<app-heroes id="authorized" *ngIf="isAuthorized"></app-heroes> <app-heroes id="authorized" *ngIf="isAuthorized"></app-heroes>
<app-heroes id="unauthorized" *ngIf="!isAuthorized"></app-heroes> <app-heroes id="unauthorized" *ngIf="!isAuthorized"></app-heroes>
<app-providers></app-providers> <app-providers></app-providers>
` `,
providers: [Logger]
}) })
export class AppComponent { export class AppComponent {
title: string; title: string;

View File

@ -1,13 +1,15 @@
import { AppConfig } from './app-config';
export { AppConfig } from './app-config';
// #docregion token // #docregion token
import { InjectionToken } from '@angular/core'; import { InjectionToken } from '@angular/core';
export const APP_CONFIG = new InjectionToken<AppConfig>('app.config'); export let APP_CONFIG = new InjectionToken<AppConfig>('app.config');
// #enddocregion token // #enddocregion token
// #docregion config // #docregion config
export interface AppConfig {
apiEndpoint: string;
title: string;
}
export const HERO_DI_CONFIG: AppConfig = { export const HERO_DI_CONFIG: AppConfig = {
apiEndpoint: 'api.heroes.com', apiEndpoint: 'api.heroes.com',
title: 'Dependency Injection' title: 'Dependency Injection'

View File

@ -1,24 +1,32 @@
// #docplaster
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { APP_CONFIG, HERO_DI_CONFIG } from './app.config';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { CarComponent } from './car/car.component'; import { CarComponent } from './car/car.component';
import { HeroesComponent } from './heroes/heroes.component'; import { HeroesComponent } from './heroes/heroes.component';
import { HeroListComponent } from './heroes/hero-list.component'; import { HeroListComponent } from './heroes/hero-list.component';
import { InjectorComponent } from './injector.component'; import { InjectorComponent } from './injector.component';
import { Logger } from './logger.service';
import { TestComponent } from './test.component'; import { TestComponent } from './test.component';
import { APP_CONFIG, HERO_DI_CONFIG } from './app.config';
import { UserService } from './user.service'; import { UserService } from './user.service';
import {
import { ProvidersModule } from './providers.module'; ProvidersComponent,
Provider1Component,
Provider3Component,
Provider4Component,
Provider5Component,
Provider6aComponent,
Provider6bComponent,
Provider7Component,
Provider8Component,
Provider9Component,
Provider10Component,
} from './providers.component';
// #docregion ngmodule // #docregion ngmodule
@NgModule({ @NgModule({
imports: [ imports: [
BrowserModule, BrowserModule
ProvidersModule
], ],
declarations: [ declarations: [
AppComponent, AppComponent,
@ -27,19 +35,26 @@ import { ProvidersModule } from './providers.module';
// #enddocregion ngmodule // #enddocregion ngmodule
HeroListComponent, HeroListComponent,
InjectorComponent, InjectorComponent,
TestComponent TestComponent,
ProvidersComponent,
Provider1Component,
Provider3Component,
Provider4Component,
Provider5Component,
Provider6aComponent,
Provider6bComponent,
Provider7Component,
Provider8Component,
Provider9Component,
Provider10Component,
// #docregion ngmodule // #docregion ngmodule
], ],
// #docregion providers, providers-2 // #docregion ngmodule-providers
providers: [ providers: [
// #enddocregion providers
Logger,
// #docregion providers
UserService, UserService,
{ provide: APP_CONFIG, useValue: HERO_DI_CONFIG } { provide: APP_CONFIG, useValue: HERO_DI_CONFIG }
], ],
// #enddocregion providers, providers-2 // #enddocregion ngmodule-providers
exports: [ CarComponent, HeroesComponent ],
bootstrap: [ AppComponent ] bootstrap: [ AppComponent ]
}) })
export class AppModule { } export class AppModule { }

View File

@ -1,25 +0,0 @@
/// Dummy modules to satisfy Angular Language Service
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AppModule } from './app.module';
////////
import { AppComponent as AppComponent1 } from './app.component.1';
@NgModule({
imports: [ CommonModule, AppModule ],
declarations: [ AppComponent1 ]
})
export class DummyModule1 {}
/////////
import { AppComponent as AppComponent2 } from './app.component.2';
@NgModule({
imports: [ CommonModule, AppModule ],
declarations: [ AppComponent2 ]
})
export class DummyModule2 {}

View File

@ -1,35 +0,0 @@
/// Dummy modules to satisfy Angular Language Service
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
////////
import { HeroListComponent as HeroListComponent1 } from './hero-list.component.1';
@NgModule({
imports: [ CommonModule ],
declarations: [ HeroListComponent1 ],
exports: [ HeroListComponent1 ]
})
export class DummyModule1 {}
/////////
import { HeroListComponent as HeroListComponent2 } from './hero-list.component.2';
@NgModule({
imports: [ CommonModule ],
declarations: [ HeroListComponent2 ]
})
export class DummyModule2 {}
/////////
import { HeroesComponent as HeroesComponent1 } from './heroes.component.1';
@NgModule({
imports: [ CommonModule, DummyModule1 ],
declarations: [ HeroesComponent1 ]
})
export class DummyModule3 {}

View File

@ -1,5 +1,6 @@
// #docregion // #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { HEROES } from './mock-heroes'; import { HEROES } from './mock-heroes';
@Component({ @Component({
@ -10,8 +11,6 @@ import { HEROES } from './mock-heroes';
</div> </div>
` `
}) })
// #docregion class
export class HeroListComponent { export class HeroListComponent {
heroes = HEROES; heroes = HEROES;
} }
// #enddocregion class

View File

@ -1,6 +1,7 @@
// #docplaster // #docplaster
// #docregion // #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { Hero } from './hero'; import { Hero } from './hero';
// #enddocregion // #enddocregion
import { HeroService } from './hero.service.1'; import { HeroService } from './hero.service.1';

View File

@ -1,6 +1,7 @@
/* tslint:disable:one-line */ /* tslint:disable:one-line */
// #docregion // #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { Hero } from './hero'; import { Hero } from './hero';
import { HeroService } from './hero.service'; import { HeroService } from './hero.service';

View File

@ -1,6 +0,0 @@
import { Injectable } from '@angular/core';
@Injectable()
export class HeroService {
constructor() { }
}

View File

@ -1,5 +1,6 @@
// #docregion // #docregion
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HEROES } from './mock-heroes'; import { HEROES } from './mock-heroes';
@Injectable() @Injectable()

View File

@ -1,5 +1,6 @@
// #docregion // #docregion
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HEROES } from './mock-heroes'; import { HEROES } from './mock-heroes';
import { Logger } from '../logger.service'; import { Logger } from '../logger.service';

View File

@ -1,5 +1,6 @@
// #docregion // #docregion
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HEROES } from './mock-heroes'; import { HEROES } from './mock-heroes';
import { Logger } from '../logger.service'; import { Logger } from '../logger.service';

View File

@ -1,14 +1,17 @@
// #docplaster // #docplaster
// #docregion, v1 // #docregion full, v1
import { Component } from '@angular/core'; import { Component } from '@angular/core';
// #enddocregion v1 // #enddocregion v1
import { HeroService } from './hero.service';
// #docregion v1 import { HeroService } from './hero.service';
// #enddocregion full
// #docregion full, v1
@Component({ @Component({
selector: 'app-heroes', selector: 'app-heroes',
// #enddocregion v1 // #enddocregion v1
providers: [ HeroService ], providers: [HeroService],
// #docregion v1 // #docregion v1
template: ` template: `
<h2>Heroes</h2> <h2>Heroes</h2>

View File

@ -1,13 +1,14 @@
// #docregion // #docregion
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { heroServiceProvider } from './hero.service.provider'; import { heroServiceProvider } from './hero.service.provider';
@Component({ @Component({
selector: 'app-heroes', selector: 'app-heroes',
providers: [ heroServiceProvider ],
template: ` template: `
<h2>Heroes</h2> <h2>Heroes</h2>
<app-hero-list></app-hero-list> <app-hero-list></app-hero-list>
` `,
providers: [heroServiceProvider]
}) })
export class HeroesComponent { } export class HeroesComponent { }

View File

@ -1,12 +1,9 @@
/* /* tslint:disable:one-line:check-open-brace*/
* A collection of demo components showing different ways to provide services // Examples of provider arrays
* in @Component metadata // #docplaster
*/
import { Component, Inject, Injectable, OnInit } from '@angular/core'; import { Component, Inject, Injectable, OnInit } from '@angular/core';
import { import { APP_CONFIG, AppConfig,
APP_CONFIG,
AppConfig,
HERO_DI_CONFIG } from './app.config'; HERO_DI_CONFIG } from './app.config';
import { HeroService } from './heroes/hero.service'; import { HeroService } from './heroes/hero.service';
@ -14,8 +11,9 @@ import { heroServiceProvider } from './heroes/hero.service.provider';
import { Logger } from './logger.service'; import { Logger } from './logger.service';
import { UserService } from './user.service'; import { UserService } from './user.service';
const template = '{{log}}'; let template = '{{log}}';
//////////////////////////////////////////
@Component({ @Component({
selector: 'provider-1', selector: 'provider-1',
template: template, template: template,
@ -32,7 +30,6 @@ export class Provider1Component {
} }
////////////////////////////////////////// //////////////////////////////////////////
@Component({ @Component({
selector: 'provider-3', selector: 'provider-3',
template: template, template: template,
@ -50,7 +47,7 @@ export class Provider3Component {
} }
////////////////////////////////////////// //////////////////////////////////////////
export class BetterLogger extends Logger {} class BetterLogger extends Logger {}
@Component({ @Component({
selector: 'provider-4', selector: 'provider-4',
@ -69,10 +66,9 @@ export class Provider4Component {
} }
////////////////////////////////////////// //////////////////////////////////////////
// #docregion EvenBetterLogger // #docregion EvenBetterLogger
@Injectable() @Injectable()
export class EvenBetterLogger extends Logger { class EvenBetterLogger extends Logger {
constructor(private userService: UserService) { super(); } constructor(private userService: UserService) { super(); }
log(message: string) { log(message: string) {
@ -100,10 +96,8 @@ export class Provider5Component {
} }
////////////////////////////////////////// //////////////////////////////////////////
class NewLogger extends Logger {}
export class NewLogger extends Logger {} class OldLogger {
export class OldLogger {
logs: string[] = []; logs: string[] = [];
log(message: string) { log(message: string) {
throw new Error('Should not call the old logger!'); throw new Error('Should not call the old logger!');
@ -155,14 +149,11 @@ export class Provider6bComponent {
} }
////////////////////////////////////////// //////////////////////////////////////////
// #docregion silent-logger // #docregion silent-logger
// An object in the shape of the logger service // An object in the shape of the logger service
export function SilentLoggerFn() {} let silentLogger = {
const silentLogger = {
logs: ['Silent logger says "Shhhhh!". Provided via "useValue"'], logs: ['Silent logger says "Shhhhh!". Provided via "useValue"'],
log: SilentLoggerFn log: () => {}
}; };
// #enddocregion silent-logger // #enddocregion silent-logger
@ -181,7 +172,6 @@ export class Provider7Component {
this.log = logger.logs[0]; this.log = logger.logs[0];
} }
} }
///////////////// /////////////////
@Component({ @Component({
@ -199,7 +189,6 @@ export class Provider8Component {
} }
///////////////// /////////////////
@Component({ @Component({
selector: 'provider-9', selector: 'provider-9',
template: template, template: template,
@ -229,7 +218,6 @@ export class Provider9Component implements OnInit {
this.log = 'APP_CONFIG Application title is ' + this.config.title; this.log = 'APP_CONFIG Application title is ' + this.config.title;
} }
} }
////////////////////////////////////////// //////////////////////////////////////////
// Sample providers 1 to 7 illustrate a required logger dependency. // Sample providers 1 to 7 illustrate a required logger dependency.
// Optional logger, can be null // Optional logger, can be null
@ -260,7 +248,6 @@ export class Provider10Component implements OnInit {
} }
///////////////// /////////////////
@Component({ @Component({
selector: 'app-providers', selector: 'app-providers',
template: ` template: `

View File

@ -1,33 +0,0 @@
import { NgModule } from '@angular/core';
import {
Provider1Component,
Provider3Component,
Provider4Component,
Provider5Component,
Provider6aComponent,
Provider6bComponent,
Provider7Component,
Provider8Component,
Provider9Component,
Provider10Component,
ProvidersComponent,
} from './providers.component';
@NgModule({
declarations: [
Provider1Component,
Provider3Component,
Provider4Component,
Provider5Component,
Provider6aComponent,
Provider6bComponent,
Provider7Component,
Provider8Component,
Provider9Component,
Provider10Component,
ProvidersComponent,
],
exports: [ ProvidersComponent ]
})
export class ProvidersModule {}

View File

@ -4,7 +4,6 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { Hero } from './heroes/hero';
import { HeroService } from './heroes/hero.service'; import { HeroService } from './heroes/hero.service';
import { HeroListComponent } from './heroes/hero-list.component'; import { HeroListComponent } from './heroes/hero-list.component';
@ -23,13 +22,12 @@ export class TestComponent {
function runTests() { function runTests() {
// #docregion spec // #docregion spec
const expectedHeroes = [{name: 'A'}, {name: 'B'}] let expectedHeroes = [{name: 'A'}, {name: 'B'}]
const mockService = <HeroService> {getHeroes: () => expectedHeroes } let mockService = <HeroService> {getHeroes: () => expectedHeroes }
it('should have heroes when HeroListComponent created', () => { it('should have heroes when HeroListComponent created', () => {
// Pass the mock to the constructor as the Angular injector would let hlc = new HeroListComponent(mockService);
const component = new HeroListComponent(mockService); expect(hlc.heroes.length).toEqual(expectedHeroes.length);
expect(component.heroes.length).toEqual(expectedHeroes.length);
}); });
// #enddocregion spec // #enddocregion spec

View File

@ -0,0 +1,15 @@
// #docregion
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<h1>Simple Deployment</h1>
<nav>
<a routerLink="/crisis-center" routerLinkActive="active">Crisis Center</a>
<a routerLink="/heroes" routerLinkActive="active">Heroes</a>
</nav>
<router-outlet></router-outlet>
`
})
export class AppComponent { }

View File

@ -0,0 +1,29 @@
// #docregion
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
import { CrisisListComponent } from './crisis-list.component';
import { HeroListComponent } from './hero-list.component';
const appRoutes: Routes = [
{ path: 'crisis-center', component: CrisisListComponent },
{ path: 'heroes', component: HeroListComponent },
{ path: '', redirectTo: '/heroes', pathMatch: 'full' }
];
@NgModule({
imports: [
BrowserModule,
RouterModule.forRoot(appRoutes)
],
declarations: [
AppComponent,
CrisisListComponent,
HeroListComponent
],
bootstrap: [ AppComponent ]
})
export class AppModule { }

View File

@ -0,0 +1,9 @@
// #docregion
import { Component } from '@angular/core';
@Component({
template: `
<h2>CRISIS CENTER</h2>
<p>Get your crisis here</p>`
})
export class CrisisListComponent { }

View File

@ -0,0 +1,10 @@
// #docregion
import { Component } from '@angular/core';
@Component({
template: `
<h2>HEROES</h2>
<p>Get your heroes here</p>
`
})
export class HeroListComponent { }

View File

@ -0,0 +1,38 @@
<!-- #docregion -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Doesn't load from node_modules! -->
<!-- Set the base href -->
<base href="/">
<title>Simple Deployment</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- #docregion node-module-scripts -->
<!-- Polyfills -->
<script src="https://unpkg.com/core-js/client/shim.min.js"></script>
<!-- Update these package versions as needed -->
<script src="https://unpkg.com/zone.js@0.8.4?main=browser"></script>
<script src="https://unpkg.com/systemjs@0.19.39/dist/system.src.js"></script>
<!-- #enddocregion node-module-scripts -->
<!-- #docregion systemjs-config -->
<!-- This SystemJS configuration loads umd packages from the web -->
<script src="systemjs.config.server.js"></script>
<!-- #enddocregion systemjs-config -->
<script>
System.import('main.js')
.catch(function(err){ console.error(err); });
</script>
</head>
<body>
<my-app></my-app>
</body>
</html>

View File

@ -1,12 +1,15 @@
// #docregion // #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module'; import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) { // #docregion enableProdMode
import { enableProdMode } from '@angular/core';
// Enable production mode unless running locally
if (!/localhost/.test(document.location.host)) {
enableProdMode(); enableProdMode();
} }
// #enddocregion enableProdMode
platformBrowserDynamic().bootstrapModule(AppModule); platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -0,0 +1,46 @@
// #docregion
/**
* System configuration for deployment without installing node_modules
* Loads umd packages from the web instead
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
// #docregion paths
paths: {
'npm:': 'https://unpkg.com/' // path serves as alias
},
// #enddocregion paths
// map tells the System loader where to look for things
map: {
app: 'app', // location of transpiled app files
// angular minimized umd bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.min.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.min.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.min.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.min.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.min.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.min.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.min.js',
'@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.min.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.min.js',
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.min.js',
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.min.js',
// other libraries
'rxjs': 'npm:rxjs@5.0.1',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this);

View File

@ -1,5 +1,6 @@
{ {
"description": "Displaying Data", "description": "Displaying Data",
"basePath": "src/",
"files": [ "files": [
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",

View File

@ -1,5 +1,6 @@
{ {
"description": "Authors style guide", "description": "Authors style guide",
"basePath": "src/",
"files": [ "files": [
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",

View File

@ -0,0 +1,9 @@
{
"description": "Second authors style guide plunker (non-executing)",
"basePath": "src/",
"files": [
"index.2.html"
],
"main": "index.2.html",
"tags": ["author", "style guide"]
}

View File

@ -1,8 +0,0 @@
{
"description": "Second authors style guide stackblitz (non-executing)",
"files": [
"src/index.2.html"
],
"main": "src/index.2.html",
"tags": ["author", "style guide"]
}

View File

@ -1,5 +1,6 @@
{ {
"description": "Dynamic Component Loader", "description": "Dynamic Component Loader",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js" "!**/*.js"

View File

@ -1,5 +1,6 @@
{ {
"description": "Dynamic Form", "description": "Dynamic Form",
"basePath": "src/",
"files":[ "files":[
"!**/*.d.ts", "!**/*.d.ts",
"!**/*.js", "!**/*.js",

View File

@ -1,17 +0,0 @@
import { AppPage } from './app.po';
describe('feature-modules App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('app works!');
});
});

View File

@ -1,4 +0,0 @@
{
"build": "build:cli",
"run": "serve:cli"
}

View File

@ -1,9 +0,0 @@
<!-- #docplaster -->
<!-- #docregion app-component-template -->
<h1>
{{title}}
</h1>
<!-- add the selector from the CustomerDashboardComponent -->
<app-customer-dashboard></app-customer-dashboard>
<!-- #enddocregion app-component-template -->

View File

@ -1,32 +0,0 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
});
TestBed.compileComponents();
});
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('app works!');
}));
});

View File

@ -1,10 +0,0 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
}

Some files were not shown because too many files have changed in this diff Show More