File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
packages/angular-cli/blueprints/ng2 Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ import { Component } from '@angular/core';<% if (isMobile) { %>
22import { APP_SHELL_DIRECTIVES } from '@angular/app-shell' ; < % } % >
33
44@Component ( {
5- selector : '<%= prefix %>-root' , < % if ( isMobile || inlineTemplate ) { % >
5+ selector : '<%= prefix %>-root' , < % if ( inlineTemplate ) { % >
66 template : `
77 <h1>
88 {{title}}
99 </h1>
1010 ` , < % } else { % >
11- templateUrl : './app.component.html' , < % } % > < % if ( isMobile || inlineStyle ) { % >
11+ templateUrl : './app.component.html' , < % } % > < % if ( inlineStyle ) { % >
1212 styles : [ ] < % } else { % >
1313 styleUrls : [ './app.component.<%= styleExt %>' ] < % } % >
1414} )
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module.exports = {
3232 . replace ( / - ( .) / g, ( _ , l ) => ' ' + l . toUpperCase ( ) )
3333 . replace ( / ^ ./ , ( l ) => l . toUpperCase ( ) ) ;
3434
35+ // For mobile projects, force inline styles and templates.
36+ if ( options . mobile ) {
37+ options . inlineStyle = true ;
38+ options . inlineTemplate = true ;
39+ }
40+
3541 return {
3642 htmlComponentName : stringUtils . dasherize ( options . entity . name ) ,
3743 jsComponentName : stringUtils . classify ( options . entity . name ) ,
@@ -50,10 +56,7 @@ module.exports = {
5056
5157 files : function ( ) {
5258 var fileList = getFiles . call ( this ) ;
53- if ( this . options && this . options . mobile ) {
54- fileList = fileList . filter ( p => p . indexOf ( 'app.component.html' ) < 0 ) ;
55- fileList = fileList . filter ( p => p . indexOf ( 'app.component.__styleext__' ) < 0 ) ;
56- }
59+
5760 if ( this . options && ! this . options . routing ) {
5861 fileList = fileList . filter ( p => p . indexOf ( 'app-routing.module.ts' ) < 0 ) ;
5962 }
You can’t perform that action at this time.
0 commit comments