简体   繁体   English

我应该为AngularJS使用Angular材料还是材质?

[英]Should I use Material for Angular or Material for AngularJS?

Angular's GitHub page shows two pinned repositories relating to Material Design: Angular的GitHub页面显示了与Material Design相关的两个固定存储库:

  1. angular/material2 角/材料2
  2. angular/material 角/材料

The README.md for angular/material is titled Material Design for AngularJS Apps . 角度/材质README.md标题为AngularJS Apps的Material Design

The README.md for angular/material2 is titled Material Design for Angular . angular / material2README.md名为Material Design for Angular

I'm building an Angular2 web application using the angular-cli and have both installed and imported @angular/material into app.module.ts . 我正在使用angular-cli构建一个Angular2 Web应用程序,并已将@angular/material 安装导入app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { MaterialModule } from '@angular/material'
import { FlexLayoutModule } from '@angular/flex-layout'

    @NgModule({
      declarations: [
        AppComponent,
      ],
      imports: [
        BrowserModule,
        HttpModule,
        FlexLayoutModule,
        MaterialModule
      ],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }

I assume I should be following the documentation at material.angular.io and not material.angularjs.org ? 我假设我应该关注material.angular.io而不是material.angularjs.org的文档?

Questions: 问题:

  1. Can someone verify the following is correct? 有人可以验证以下是否正确?

  2. Given that material.angular.io seems pretty (very?) limited in layouts, components, etc when compared to material.angularjs.org , should I use material.angularjs.org in my application to take advantage of the numerous layouts and widgets, etc? 鉴于material.angular.io似乎在布局,组件等时相比,漂亮(很?)有限material.angularjs.org ,我应该使用material.angularjs.org在我的应用程序采取了许多布局和小部件的优势,等等?

  3. Can angular/flex-layout be used with both? 角度/柔性布局可以同时使用吗?

When building an app with Angular (V2 or +), you should use angular/material2 (github) and the doc at material.angular.io . 使用Angular(V2或+)构建应用程序时,应使用angular / material2 (github)和material.angular.io上的doc。

Do not use material.angularjs.org as it is for AngularJs apps. 不要像使用AngularJs应用程序那样使用material.angularjs.org

As you noticed, material2 doesn't have much to handle the layout and you should use angular/flex-layout for that. 正如您所注意到的,material2没有太多处理布局,您应该使用angular / flex-layout

It's written in material2 repo Readme : 它写在material2 repo自述文件中:

在此输入图像描述

BTW, personal opinion here but it's great that they decided to split the layout from the components so even if you decide to use other components you can still have a responsive layout thanks to angular/flex-layout. 顺便说一句,这里的个人意见,但很高兴他们决定从组件中分离布局,所以即使你决定使用其他组件,你仍然可以通过角度/弹性布局来获得响应式布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM