@@ -23,7 +23,6 @@ import {
2323} from '../utility/routing' ;
2424
2525import { getSourceFile } from '../utility/source' ;
26- import { isAngularVersionHigherThan } from '../utility/angular-version' ;
2726
2827import { strings , basename , normalize , dirname , Path } from '@angular-devkit/core' ;
2928
@@ -140,19 +139,10 @@ function overwriteModuleContent(options: any, path: string, content: string) {
140139 } ;
141140}
142141
143- function getComponentFileNames ( name : string , host : Tree ) {
142+ function getComponentFileNames ( name : string ) {
144143 const baseName = strings . dasherize ( basename ( normalize ( name ) ) ) ;
145144 const path = `${ dirname ( name as Path ) } /${ baseName } ` ;
146145
147- if ( isAngularVersionHigherThan ( host , 20 ) ) {
148- return {
149- path,
150- ts : `${ path } /${ baseName } .ts` as Path ,
151- html : `${ path } /${ baseName } .html` as Path ,
152- style : `${ path } /${ baseName } .scss` as Path
153- } ;
154- }
155-
156146 return {
157147 path,
158148 ts : `${ path } /${ baseName } .component.ts` as Path ,
@@ -161,8 +151,8 @@ function getComponentFileNames(name: string, host: Tree) {
161151 } ;
162152}
163153
164- function addContentToView ( options : any , host : Tree ) {
165- const { html } = getComponentFileNames ( options . name , host ) ;
154+ function addContentToView ( options : any ) {
155+ const { html } = getComponentFileNames ( options . name ) ;
166156 const title = humanize ( strings . dasherize ( basename ( normalize ( options . name ) ) ) ) ;
167157 const content = `<h2>${ title } </h2>
168158<div class="content-block">
@@ -173,8 +163,8 @@ function addContentToView(options: any, host: Tree) {
173163 return overwriteModuleContent ( options , html , content ) ;
174164}
175165
176- async function addContentToTS ( options : any , host : Tree ) {
177- const { ts, html, style } = getComponentFileNames ( options . name , host ) ;
166+ async function addContentToTS ( options : any ) {
167+ const { ts, html, style } = getComponentFileNames ( options . name ) ;
178168 const name = strings . dasherize ( basename ( normalize ( options . name ) ) ) ;
179169 const componentName = strings . classify ( basename ( normalize ( name ) ) ) ;
180170 const content = `import { Component } from '@angular/core';
@@ -209,8 +199,8 @@ export default function(options: any): Rule {
209199 prefix : options . prefix ,
210200 standalone : true
211201 } ) ,
212- addContentToView ( { name, project } , host ) as any ,
213- addContentToTS ( { name, project } , host ) as any
202+ addContentToView ( { name, project } ) as any ,
203+ addContentToTS ( { name, project } ) as any
214204 ] ;
215205
216206 if ( addRoute ) {
0 commit comments