Creating a Fullstack Project
This part of the guide will walk you through the creation of an AngularJS project from scratch. We will use Grunt as a build tool, and Yeoman as a scaffolding tool.
We will use Node.JS as our backend server, with the Stormpath Express SDK.
Installing Node, Grunt, Bower and Yeoman
If you haven’t installed Node.js on your system you can get it from https://nodejs.org.
Then you need to install Grunt, a tool for helping you build your project. This must be installed as a global npm package:
$ npm install -g grunt-cli
The next tool you need is Yeoman, a is a “scaffolding” tool (it makes it easy to create repeatable boilerplate code). This must also be installed as a global NPM package:
$ npm install -g yo
Finally, we will install Bower, a package manager for front-end applications:
$ npm install -g bower
Create an Angular-Fullstack Project
We are going to use the Angular Fullstack Generator. It’s going to create a LOT of files for us; essentially, our entire development environment and the seed files for the client AND server. This is really amazing!
To use the generator, you need to first install it as a global node module:
$ npm install -g generator-angular-fullstack
At this point, you should create a directory for your project and change into it:
$ mkdir my-angular-project && cd $_
Once there, we use the generator to create the project. We need to give our application a name (it does not have to be the same as the folder). Since we are building a basic user dashboard for our API, we will call it “dashboard”:
$ yo angular-fullstack dashboard
The generator will ask you several questions, such as which templating engine to use. We’re sticking to vanilla HTML/CSS/JS for this guide. The only opinionated choice we are making is to use the 3rd-partyUI Router instead of Angular’s default. Here are the choices that we made:
# Client
? What would you like to write scripts with? JavaScript
? What would you like to write markup with? HTML
? What would you like to write stylesheets with? CSS
? What Angular router would you like to use? uiRouter
? Would you like to include Bootstrap? Yes
? Would you like to include UI Bootstrap? No
# Server
? Would you like to use mongoDB with Mongoose for data modeling? No
Assuming everything installs OK, you should now have the default project ready to go. Use this grunt command to start the development server and see the application:
$ grunt serve
It should automatically open this page in your browser:
Now would be a good time to start using Git with your project. You can stop the server by pressingCtrl+C - then use these git commands:
$ git init
$ git add .
$ git commit -m "Begin dasbhoard app project"
Install the Stormpath Packages
We need to add two packages to this project: the Stormpath Express SDK and the Stormpath Angular SDK. Because the Angular SDK is a front-end application, it is managed with Bower.
Install them with these commands, which will also persist them to your package.json and bower.jsonfiles:
$ npm install --save stormpath-sdk-express
$ bower install --save stormpath-sdk-angularjs
Upgrade Express
We also want to make sure that we are using the latest version of Express. Run this command to get the latest:
$ npm i express@latest --save
In the next section, we will get your Stormpath Tenant information, so that we can continue with the latter sections.
相关推荐
fullstack-demo, Angular fullstack生成器可以进行支架的示例 使用 Angular Fullstack 生成的 Fullstack Angular Fullstack 是一个平均生成器。 它使用 MongoDB 。Express 。AngularJS和 node 来搭建应用程序。通过...
Angular Full Stack是一个使用真实的后端和数据库轻松开始使用最新Angular的项目。 从前端到后端,整个堆栈都使用TypeScript,这为您提供了在整个堆栈中使用一种语言进行编码的优势。 该项目使用: ( ):数据库...
"angular-fullstack-sample" 是一个基于 Angular Fullstack 框架的示例项目,它的主要目的是展示如何构建一个服务端渲染(Server-Side Rendering, SSR)的单页应用程序(Single Page Application, SPA)。Angular ...
Angular-generator-angular-fullstack.zip,带快速服务器角度全堆栈生成器的yeoman angularjs生成器,Angularjs于2016年发布,是Angularjs的重写版。它专注于良好的移动开发、模块化和改进的依赖注入。angular的设计...
源代码: : 用法安装yo , grunt-cli , bower和generator-angular-fullstack : npm install -g yo grunt-cli bower generator-angular-fullstack 新建一个目录,并cd到其中: mkdir my-new-project && cd $_ 运行...
angular-fullstack-ionic-starter Angular Fullstack Ionic 背后的动机是简化包含 API、Angular webapp 和 Ionic 应用程序的项目的开发。 它的核心设计原则包括尽可能共享代码和资产、创建高效的工作流程以及使用开...
mean-fullstack-pokemonApp 使用 angular fullstack Backend 进行基本 CRUD 操作的简单应用程序设置在 api Frontend 访问 REST api 服务下以显示和更新数据
Angular Fullstack CRUD - 本地版本 要从 npm 安装 generator-angular-fullstack-crud-local,请转到项目目录并运行: $ npm link 接下来,确保您有一个(大部分?)空白版本的 angular-fullstack 站点。 为获得...
Angular-Fullstack 图片上传示例这是如何使用 Yeoman 和 angular-fullstack 生成器将图像从客户端发布到服务器的示例。 这样做的一些挑战是 angular 应用程序在所有请求上附加一个安全令牌,这意味着您不能只使用...
**RestOS:基于Angular Fullstack的餐厅销售点系统** 在当今的餐饮行业中,高效、便捷的销售点(Point of Sale, POS)系统是必不可少的工具。`RestOS` 是一个专为餐厅设计的销售点系统,它利用了现代前端框架 `...
$ npm install -g generator-angular-fullstack 初始化: $ mkdir yod3 $ cd yod3 $ yo angular-fullstack yod3 $ bower install --save jquery d3 nvd3 $ bower install angularjs-nvd3-directives --save $ grunt...
Ansible-django-angular2-fullstack-devops.zip,使用ansible/packer/terraformdjango-angular2-fullstack-devops在aws上实现多环境devops的一体化django/angular2 seed和cli接口,ansible是一个简单而强大的自动化...
源代码: : 用法安装generator-angular-fullstack : npm install -g generator-angular-fullstack新建一个目录,并cd到其中: mkdir my-new-project && cd $_运行yo angular-fullstack ,可以选择传递一个应用程序...
火球项目(由yo-angular fullstack生成) $ npm安装 $服务 本地主机:9000 / 贡献者 凯文,斯科特,丹尼尔 参考 MongoDB托管: : 引导程序组件: : Bootstrap CSS(ko): : 角度生成器: : 6方案设计规则 ...
要从npm安装generator-angular-fullstack-crud,请运行: $ npm install -g generator-angular-fullstack-crud 接下来,确保您有一个(通常是?)空白的角全堆栈站点。 为了获得最佳结果,请在完全新的/新的全角...
安装yo , gulp-cli和generator-angular-fullstack : npm install -g yo gulp-cli generator-angular-fullstack 请注意:如果在安装过程中编译本机附件时遇到麻烦,请遵循的简短指南,了解。 然后,要运行您的...
【标题】"fullstack-demo-dist: Angular-Fullstack 生成器的构建产出" 【描述】"这个名为 'fullstack-demo-dist' 的压缩包包含了 Angular-Fullstack 生成器的构建结果。Angular-Fullstack 是一个强大的工具,它帮助...
Angular-Angular-Full-Stack.zip,使用angular 2 、express、mongoose和node构建的角度完整堆栈项目。字体中的整个堆栈。角度完整堆栈,Angularjs于2016年发布,是Angularjs的重写版。它专注于良好的移动开发、模块化...
Hands-On Full Stack Web Development with Angular 6 and Laravel 5 完整pdf, 無水印
**Angular全栈测试应用概述** Angular 是一个流行的前端JavaScript框架,由Google维护,主要用于构建单页应用程序(SPA)。它提供了一种结构化的方式来组织和管理Web应用,使得开发者能够更高效地开发、测试和维护...