File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/lib/schematics/utils/devkit-utils Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -82,17 +82,17 @@ function addDeclarationToNgModule(options: any): Rule {
8282 } ;
8383}
8484
85-
86- function buildSelector ( options : any ) {
85+ function buildSelector ( options : any , projectPrefix : string ) {
8786 let selector = strings . dasherize ( options . name ) ;
8887 if ( options . prefix ) {
8988 selector = `${ options . prefix } -${ selector } ` ;
89+ } else if ( options . prefix === undefined && projectPrefix ) {
90+ selector = `${ projectPrefix } -${ selector } ` ;
9091 }
9192
9293 return selector ;
9394}
9495
95-
9696export function buildComponent ( options : any ) : Rule {
9797 return ( host : Tree , context : SchematicContext ) => {
9898 const workspace = getWorkspace ( host ) ;
@@ -105,7 +105,7 @@ export function buildComponent(options: any): Rule {
105105 options . path = `/${ project . root } /src/app` ;
106106 }
107107
108- options . selector = options . selector || buildSelector ( options ) ;
108+ options . selector = options . selector || buildSelector ( options , project . prefix ) ;
109109 options . module = findModuleFromOptions ( host , options ) ;
110110
111111 const parsedPath = parseName ( options . path , options . name ) ;
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ export interface Workspace {
4949export interface Project {
5050 name : string ;
5151
52+ /** Application prefix. */
53+ prefix : string ;
54+
5255 /** Project type. */
5356 projectType : 'application' | 'library' ;
5457 /** Root of the project sourcefiles. */
You can’t perform that action at this time.
0 commit comments