File tree 2 files changed +9
-6
lines changed
packages/angular-cli/blueprints/ng2
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) { %>
2
2
import { APP_SHELL_DIRECTIVES } from '@angular/app-shell' ; < % } % >
3
3
4
4
@Component ( {
5
- selector : '<%= prefix %>-root' , < % if ( isMobile || inlineTemplate ) { % >
5
+ selector : '<%= prefix %>-root' , < % if ( inlineTemplate ) { % >
6
6
template : `
7
7
<h1>
8
8
{{title}}
9
9
</h1>
10
10
` , < % } else { % >
11
- templateUrl : './app.component.html' , < % } % > < % if ( isMobile || inlineStyle ) { % >
11
+ templateUrl : './app.component.html' , < % } % > < % if ( inlineStyle ) { % >
12
12
styles : [ ] < % } else { % >
13
13
styleUrls : [ './app.component.<%= styleExt %>' ] < % } % >
14
14
} )
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ module.exports = {
32
32
. replace ( / - ( .) / g, ( _ , l ) => ' ' + l . toUpperCase ( ) )
33
33
. replace ( / ^ ./ , ( l ) => l . toUpperCase ( ) ) ;
34
34
35
+ // For mobile projects, force inline styles and templates.
36
+ if ( options . mobile ) {
37
+ options . inlineStyle = true ;
38
+ options . inlineTemplate = true ;
39
+ }
40
+
35
41
return {
36
42
htmlComponentName : stringUtils . dasherize ( options . entity . name ) ,
37
43
jsComponentName : stringUtils . classify ( options . entity . name ) ,
@@ -50,10 +56,7 @@ module.exports = {
50
56
51
57
files : function ( ) {
52
58
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
+
57
60
if ( this . options && ! this . options . routing ) {
58
61
fileList = fileList . filter ( p => p . indexOf ( 'app-routing.module.ts' ) < 0 ) ;
59
62
}
You can’t perform that action at this time.
0 commit comments