Git Product home page Git Product logo

code's Introduction

Angular权威教程(ng-book2)范例代码

这是《Angular权威指南》的随书源码。请结合此书进行阅读和练习。

试运行

大多数的目录下都有一个README.md文件,可参照其中的命令进行试运行。

由于部分依赖包位于AWS S3服务器上,所以国内可能无法正常运行,请参照 https://npm.taobao.org/ 上的指引,安装cnpm,并且使用cnpm install命令代替相应的npm install命令进行安装。

还有一部分API可能会访问国外的服务器,也可能会被墙,试运行时请注意。

Angular 版本

这些源码所依赖的Angular版本是2.x,但不用担心,你可以很轻松的把它升级到 4.x,本书中的代码几乎都没有涉及从2到4的少数几个破坏性变更,参见 https://github.com/angular/angular/blob/master/CHANGELOG.md

授权协议

部分目录下的源码有一个LICENSE.md文件,采用MIT协议的源码都可以全部或部分用在你自己的项目中,但需要遵循MIT协议的要求。

code's People

Contributors

asnowwolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code's Issues

rxjs/chat build error

rxjs/chat/test/app.sepc.ts:

import {Calculator} from 'calculator';
should be
import {Calculator} from './calculator';

image

npm install error

> [email protected] install /data/website/webtest/angular-code-book/routes/music/node_modules/utf-8-validate
> node-gyp rebuild

make: Entering directory '/data/website/webtest/angular-code-book/routes/music/node_modules/utf-8-validate/build'
  CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../node_modules/nan/nan.h:190,
                 from ../src/validation.cc:15:
../node_modules/nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../node_modules/nan/nan_maybe_43_inl.h:88:15: error: ‘class v8::Object’ has no member named ‘ForceSet’
   return obj->ForceSet(GetCurrentContext(), key, value, attribs);
               ^~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’:
../node_modules/nan/nan.h:817:60: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, func, argc, argv);
                                                            ^
In file included from ../src/validation.cc:8:
/home/amor/.node-gyp/10.5.0/include/node/node.h:172:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h:817:60: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, func, argc, argv);
                                                            ^
In file included from ../src/validation.cc:8:
/home/amor/.node-gyp/10.5.0/include/node/node.h:172:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’:
../node_modules/nan/nan.h:831:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, symbol, argc, argv);
                                                              ^
In file included from ../src/validation.cc:8:
/home/amor/.node-gyp/10.5.0/include/node/node.h:165:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h:831:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, symbol, argc, argv);
                                                              ^
In file included from ../src/validation.cc:8:
/home/amor/.node-gyp/10.5.0/include/node/node.h:165:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’:
../node_modules/nan/nan.h:845:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, method, argc, argv);
                                                              ^
In file included from ../src/validation.cc:8:
/home/amor/.node-gyp/10.5.0/include/node/node.h:158:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h:845:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, method, argc, argv);
                                                              ^
In file included from ../src/validation.cc:8:
/home/amor/.node-gyp/10.5.0/include/node/node.h:158:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::Callback::Call_(v8::Isolate*, v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’:
../node_modules/nan/nan.h:1453:5: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
     ));
     ^
In file included from ../src/validation.cc:8:
/home/amor/.node-gyp/10.5.0/include/node/node.h:172:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h:1453:5: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
     ));
     ^
In file included from ../src/validation.cc:8:
/home/amor/.node-gyp/10.5.0/include/node/node.h:172:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../src/validation.cc:15:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../node_modules/nan/nan.h:1704:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../src/validation.cc:8:
../src/validation.cc: At global scope:
/home/amor/.node-gyp/10.5.0/include/node/node.h:539:43: warning: cast between incompatible function types from ‘void (*)(v8::Handle<v8::Object>)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/home/amor/.node-gyp/10.5.0/include/node/node.h:573:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/validation.cc:146:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(validation, init)
 ^~~~~~~~~~~
In file included from ../src/validation.cc:7:
/home/amor/.node-gyp/10.5.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/amor/.node-gyp/10.5.0/include/node/node_object_wrap.h:85:78:   required from here
/home/amor/.node-gyp/10.5.0/include/node/v8.h:9360:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/amor/.node-gyp/10.5.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../node_modules/nan/nan_object_wrap.h:66:61:   required from here
/home/amor/.node-gyp/10.5.0/include/node/v8.h:9360:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
../src/validation.cc: In function ‘int is_valid_utf8(size_t, char*)’:
../src/validation.cc:81:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 5 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:82:7: note: here
       case 4 : ch += (uint8_t) value[i++]; ch <<= 6;
       ^~~~
../src/validation.cc:82:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 4 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:83:7: note: here
       case 3 : ch += (uint8_t) value[i++]; ch <<= 6;
       ^~~~
../src/validation.cc:83:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 3 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:84:7: note: here
       case 2 : ch += (uint8_t) value[i++]; ch <<= 6;
       ^~~~
../src/validation.cc:84:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 2 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:85:7: note: here
       case 1 : ch += (uint8_t) value[i++]; ch <<= 6;
       ^~~~
../src/validation.cc:85:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
       case 1 : ch += (uint8_t) value[i++]; ch <<= 6;
                                            ~~~^~~~~
../src/validation.cc:86:7: note: here
       case 0 : ch += (uint8_t) value[i];
       ^~~~
../src/validation.cc: In function ‘int isLegalUTF8(const uint8_t*, int)’:
../src/validation.cc:51:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
     case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
             ^~
../src/validation.cc:52:5: note: here
     case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
     ^~~~
../src/validation.cc:52:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
     case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
             ^~
../src/validation.cc:53:5: note: here
     case 2: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0;
     ^~~~
../src/validation.cc:54:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
       switch (*source) {
       ^~~~~~
../src/validation.cc:62:5: note: here
     case 1: if (*source >= 0x80 && *source < 0xC2) return 0;
     ^~~~
make: *** [validation.target.mk:96: Release/obj.target/validation/src/validation.o] Error 1
make: Leaving directory '/data/website/webtest/angular-code-book/routes/music/node_modules/utf-8-validate/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/amor/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.14.48-2-MANJARO
gyp ERR! command "/home/amor/.nvm/versions/node/v10.5.0/bin/node" "/home/amor/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/website/webtest/angular-code-book/routes/music/node_modules/utf-8-validate
gyp ERR! node -v v10.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN [email protected] No repository field.
npm WARN The package @types/jasmine is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/utf-8-validate):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

audited 2519 packages in 4.955s
found 101 vulnerabilities (43 low, 25 moderate, 32 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.