If you want to allow external styles to impact the content of components, you can adjust the view encapsulation to prevent styles from bleeding into components.
@Component({
selector: 'some-component',
template: '<div></div>',
styleUrls: [
'http://example.com/external.css',
'app/local.css'
],
})
It's important to note that view encapsulation serves a specific purpose. A more effective approach is to apply styles directly to the component they are intended for. ViewEncapsulation can be configured on a per-component basis and can be useful in certain scenarios.
For further information, refer to this related issue https://github.com/angular/angular/issues/5390
Here's an example for including scripts:
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/0.8.1/cropper.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/0.8.1/cropper.js"></script>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function () {
var image = document.querySelector('#image');
var cropper = new Cropper(image, {
viewMode: 3,
dragMode: 'move',
autoCropArea: 1,
restore: false,
modal: false,
guides: false,
highlight: false,
cropBoxMovable: false,
cropBoxResizable: false,
toggleDragModeOnDblclick: false,
});
});
</script>
</head>
Please note that the above links may vary depending on the CDN links for JavaScript libraries.