Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserveWhitespaces - where to put compiler option for meteor CLI & AOT #1953

Open
pmcochrane opened this issue Sep 3, 2018 · 1 comment

Comments

@pmcochrane
Copy link

Hello. I'm trying to figure out where this setting is to be placed for a meteor CLI angular-metoer app.

Angular 6 has defaulted this to on by default which removes all spaces in any HTML markup. This breaks my UI as it causes spans to butt up against each other and will be a real pain to workaround.

I have figured out how to fix this in JIT mode by adding an option to appComponent:

@Component({
	selector: "retis-app",
	templateUrl: './app.component.html',
	styleUrls: [
		'./css/0-importAllScssFiles.scss',
		'./app.component.scss',
	],
	encapsulation: ViewEncapsulation.None,	// tslint:disable-line // This makes the scss available to all components
	animations: [ routerTransition, animPatientBanner, animGrowFadeOut, animGrow ],
	preserveWhitespaces: true,
})

The fix for AOT mode seems to be to add the following to tsconfig.app.json.

"angularCompilerOptions": {
		"preserveWhitespaces": true
	},

However, there is no tsconfig.app.json file for a meteorCLI app and adding the setting to tsconfig.json does not work. Where should this be configured and what contents should it have please?

@pmcochrane pmcochrane changed the title preserverWhitespaces - where to put compiler option for meteor CLI & AOT preserveWhitespaces - where to put compiler option for meteor CLI & AOT Sep 3, 2018
@pmcochrane
Copy link
Author

The only way I have found to overcome this problem when using the AOT compiled codes is to place an ngPreserveWhitespaces attribute on each template block where the spaces are striped.

It's a shame that I've had to edit pretty much every template in the app to have ngPreserveWhitespaces. A way to disable this "feature" would be much appreciated in the compiler.

I'll leave this open for now in case that can be considered for a future version.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant