Giter Site home page Giter Site logo

angular2-questionnaire's Introduction

Angular 2 调查问卷示例项目

注意:新版本(Angular 4 + Angular CLI)已迁移至新repo

https://github.com/angular-programming/angular-questionnaire

这是由广发证券互联网金融技术团队出品的原创书籍《揭秘 Angular 2》的第三部分项目实战的源代码。

揭秘 Angular 2 封面

这个示例项目包含以下特点:

  • 遵循官方最佳实践的目录布局
  • 代码难易程度适中,方便学习
  • 功能丰富的脚手架,易于扩展使用
  • 简洁化的后端服务,聚焦前端框架学习

如何上手

调查问卷项目包括前端 frontend 目录以及后端 backend 目录。我们可以先运行后端服务,方便前端的注册与登录用户以及提供问卷相关的服务。安装过 Node.js 之后(确保你的 Node.js 版本为 6.x 及以上),在终端运行以下命令:

cd backend
npm install
node app

接下来,将终端目录定位 frontend 之中,再运行以下命令:

npm install
npm start

以上前后台的命令都执行完后,即成功启动整个项目应用。

angular2-questionnaire's People

Contributors

lightningtgc avatar lzhfe 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

Watchers

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

angular2-questionnaire's Issues

github上给的源码跟示例代码不一致

老师您好,我想问下为何github上的代码跟书本上讲解时说得代码不一致?
例如:P438-P439 --shared/questionnaire/questionnaire.component.ts中的onSubmit代码以及书上说在QuestionnaireModule模块中引入了ng2-bootstrap的AlterModule。
再如:P441页用到的this.questionnaireService.updateQuestionnaireState方法跟存在和服务中定义的不一致的情况

关于questionnaire-item.component的ngOnChanges

github上代码

  ngOnChanges(changes: SimpleChanges){
      let questionnaireChange = changes['questionnaire'];
      if(questionnaireChange.previousValue.state && 
            questionnaireChange.currentValue.state !== questionnaireChange.previousValue.state){
          this.questionnaire = changes['questionnaire'].currentValue;
          this.setState();
      }
  }

官网PAI


class SimpleChange {
constructor(previousValue: any, currentValue: any, firstChange: boolean)
previousValue : any
currentValue : any
firstChange : boolean
isFirstChange() : boolean
}

通过changes为SimpleChanges的一个对象实例,那么应该不具有questionnaire方法吧?表示那不大理解,像老师请教一下。

很着急的问题问老师

请问老师我把后端和前端的代码都运行起来了 之后在浏览器上观察 发现 注册和登录 功能 都不能达到效果 请问老师解决的方法是什么呢

无法登录注册

ng2-bootstrap.umd.min.js?1488201334751:5680 Uncaught Error: Module must be loaded as AMD or CommonJS

问卷调查系统进入 后台报错。

问卷调查系统进入 后台报错。chrome
Uncaught Error: Module must be loaded as AMD or CommonJS
at ng2-bootstrap.umd.min.js?1489573048048:5680
at ng2-bootstrap.umd.min.js?1489573048048:1
at ng2-bootstrap.umd.min.js?1489573048048:5674

Uploading QQ图片20170315183119.png…

启动报错

## Uncaught Error: Module must be loaded as AMD or CommonJS
at ng2-bootstrap.umd.min.js:5680
at ng2-bootstrap.umd.min.js:1
at ng2-bootstrap.umd.min.js:5674

(SystemJS) exports is not defined

ReferenceError: exports is not defined
    at eval (http://localhost:5555/app/shared/models/question.model.js:2:23)
    at eval (<anonymous>)
    at Object.eval (http://localhost:5555/app/shared/models/index.js:6:10)
    at eval (http://localhost:5555/app/shared/models/index.js:11:4)
Evaluating http://localhost:5555/app/shared/models/question.model.js
Evaluating http://localhost:5555/app/shared/models/index.js
Evaluating http://localhost:5555/app/shared/index.js
Evaluating http://localhost:5555/app/app.component.js
Evaluating http://localhost:5555/app/app.module.js
Evaluating http://localhost:5555/app/main.js
Error loading http://localhost:5555/app/main.js Not expecting this error? Report it at https://github.com/mgechev/angular-seed/issues

请教一下这是什么原因导致的,该怎么解决啊

ng2-bootstrap问题

image
请问这个是什么问题,该如何解决。
另外代码中ng2-bootstrap文件目录,和现在用npm,install下来的目录不一样。
image
并没有ng2-bootstrap/component/这一级目录。#

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.