$compileProvider
Configure compiler behavior.
Use $compileProvider during module configuration for compiler-level behavior:
registering directives and controlling debug metadata.
Registering Directives
angular.module('app', []).config(($compileProvider) => {
$compileProvider.directive('focusOn', () => ({
restrict: 'A',
link(scope, element) {
element.focus();
},
}));
});
Debug Metadata
Disable debug metadata in production when you do not need scope lookup from DOM nodes.
angular.module('app', []).config(($compileProvider) => {
$compileProvider.debugInfoEnabled(false);
});
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.