当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Tree.get方法代码示例

本文整理汇总了TypeScript中@angular-devkit/schematics.Tree.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Tree.get方法的具体用法?TypeScript Tree.get怎么用?TypeScript Tree.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular-devkit/schematics.Tree的用法示例。


在下文中一共展示了Tree.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getUpdateFiles

function getUpdateFiles(localFiles: Tree) {
    return [
        { path: "src/app/app.module.ts", file: localFiles.get("code/module")! },
        { path: "src/app/app.component.ts", file: localFiles.get("code/component")! },
        { path: "src/app/app.component.html", file: localFiles.get("code/component_template")! },
        { path: "src/styles.css", file: localFiles.get("assets/styles.css")! },
        { path: "src/index.html", file: localFiles.get("assets/index.html")! },
    ];
}
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:9,代码来源:index.ts

示例2: getFileContent

export function getFileContent(tree: Tree, path: string): string {
  const fileEntry = tree.get(path);

  if (!fileEntry) {
    throw new Error(`The file (${path}) does not exist.`);
  }

  return fileEntry.content.toString();
}
开发者ID:AlexChar,项目名称:platform,代码行数:9,代码来源:get-file-content.ts

示例3: envConfig

function envConfig(host: Tree, options: PluginOptions) {
  const defEnvPath = `${options.sourceRoot}/environments/environment.ts`;
  const defContent = host.get(defEnvPath).content;
  if (!host.exists(defEnvPath)) return ;
  // 1. update default env file
  addValueToVariable(host, defEnvPath, 'environment', 'hmr: false');
  // 2. update prod env file
  addValueToVariable(host, `${options.sourceRoot}/environments/environment.prod.ts`, 'environment', 'hmr: false');
  // 3. copy default env file to hmr file
  const hmrEnvPath = `${options.sourceRoot}/environments/environment.hmr.ts`;
  host.create(hmrEnvPath, defContent);
  addValueToVariable(host, hmrEnvPath, 'environment', 'hmr: true');
}
开发者ID:wexz,项目名称:delon,代码行数:13,代码来源:plugin.hmr.ts

示例4: getCreateFiles

function getCreateFiles(localFiles: Tree) {
    return [
        { path: "src/app/app-routing.module.ts", file: localFiles.get("code/routing")! },
        { path: "src/config.json", file: localFiles.get("code/config")! },
        { path: "src/assets/alt.calendar.png", file: localFiles.get("assets/alt.calendar.png")! },
        { path: "src/assets/alt.list.png", file: localFiles.get("assets/alt.list.png")! },
        { path: "src/assets/alt.summary.png", file: localFiles.get("assets/alt.summary.png")! },
        { path: "src/assets/alt.table.png", file: localFiles.get("assets/alt.table.png")! },
        { path: "src/assets/calendar.png", file: localFiles.get("assets/calendar.png")! },
        { path: "src/assets/list.png", file: localFiles.get("assets/list.png")! },
        { path: "src/assets/summary.png", file: localFiles.get("assets/summary.png")! },
        { path: "src/assets/table.png", file: localFiles.get("assets/table.png")! },
        { path: "src/fonts/iconFont.eot", file: localFiles.get("fonts/iconFont.eot")! },
        { path: "src/fonts/iconFont.svg", file: localFiles.get("fonts/iconFont.svg")! },
        { path: "src/fonts/iconFont.ttf", file: localFiles.get("fonts/iconFont.ttf")! },
        { path: "src/fonts/iconFont.woff", file: localFiles.get("fonts/iconFont.woff")! },
        { path: "src/fonts/license.txt", file: localFiles.get("fonts/license.txt")! },
        { path: "src/theme.css", file: localFiles.get("assets/theme.css")! },
        { path: "src/theme.alt.css", file: localFiles.get("assets/theme.alt.css")! },
    ];
}
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:21,代码来源:index.ts


注:本文中的@angular-devkit/schematics.Tree.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。