美文网首页
1. Angular 环境搭建和项目创建

1. Angular 环境搭建和项目创建

作者: 晨曦Bai | 来源:发表于2019-12-24 14:48 被阅读0次

    1. 官网

    https://angular.io

    2. 搭建环境

    https://angular.io/guide/setup-local

    0. Prerequisites

    yum nodejs12 (还有其他平台的安装命令)
    node -v
    -----------------------------------------------
    nodejs 官网: https://nodejs.org/en/download/package-manager/
    ubuntu/Debian 命令安装nodejs 的方法: https://github.com/nodesource/distributions/blob/master/README.md

    curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
    # Using Debian, as root
    curl -sL https://deb.nodesource.com/setup_12.x | bash -
    apt-get install -y nodejs
    
    1. Install the Angular CLI

    npm install -g @angular/cli

    2. Create a workspace and initial application

    ng new my-new-project

    3. Run the application

    cd my-new-project
    ng serve --open

    4. Build for production

    cd my-new-project
    ng build --prod

    5. Create a new component/module/service

    ng g component xxx
    ng g module xxx
    ng g service xxx

    相关文章

      网友评论

          本文标题:1. Angular 环境搭建和项目创建

          本文链接:https://www.haomeiwen.com/subject/ltxfoctx.html