123456789101112131415161718192021222324252627282930313233343536373839404142 |
- "use strict";
- /**
- * @license
- * Copyright Google LLC All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.dev/license
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.default = default_1;
- const schematics_1 = require("@angular-devkit/schematics");
- const schematics_2 = require("@angular/cdk/schematics");
- /**
- * Scaffolds a new navigation component.
- * Internally it bootstraps the base component schematic
- */
- function default_1(options) {
- return (0, schematics_1.chain)([
- (0, schematics_2.buildComponent)({ ...options }, {
- template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
- stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template',
- }),
- options.skipImport ? (0, schematics_1.noop)() : addNavModulesToModule(options),
- ]);
- }
- /**
- * Adds the required modules to the relative module.
- */
- function addNavModulesToModule(options) {
- return async (host) => {
- const isStandalone = await (0, schematics_2.isStandaloneSchematic)(host, options);
- if (!isStandalone) {
- const modulePath = (await (0, schematics_2.findModuleFromOptions)(host, options));
- (0, schematics_2.addModuleImportToModule)(host, modulePath, 'MatToolbarModule', '@angular/material/toolbar');
- (0, schematics_2.addModuleImportToModule)(host, modulePath, 'MatButtonModule', '@angular/material/button');
- (0, schematics_2.addModuleImportToModule)(host, modulePath, 'MatSidenavModule', '@angular/material/sidenav');
- (0, schematics_2.addModuleImportToModule)(host, modulePath, 'MatIconModule', '@angular/material/icon');
- (0, schematics_2.addModuleImportToModule)(host, modulePath, 'MatListModule', '@angular/material/list');
- }
- };
- }
- //# sourceMappingURL=index.js.map
|