我正在学习Angular 2,我正在使用angular-cli来
生成组件和服务.我正在使用angular-cli提出的目录结构(见下面的截图).我需要
添加一些域模型对象(例如User,Profile等),但我不知道放在哪里.
目录结构中这些对象的推荐位置是什么?

您将希望将应用程序范围的模型存储在根级别(默认值:src / app),除了这些值应该位于共享目录(src / app / shared)中.
如果使用CLI(从项目根目录)生成这些模型,您将运行:
ng generate class shared/profile model
这将产生:
src/app/shared/profile.model.ts
src/app/shared/profile.model.spec.ts
并且还将配置文件的引用添加到共享目录中的index.ts,以便您可以引用它们(从根组件)
import { Profile } from './shared';