Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set commentDirectivesEnabled and cssClassDirectivesEnabled to false in Angular

I'm attempting to make some small tweaks to my config to hopefully improve performance slightly. I read through the Angular docs here and they mention disabling comment and CSS class directives. I tried to do so with the below code in my config, but I keep getting TypeError: $compileProvider.commentDirectivesEnabled is not a function or TypeError: $compileProvider.cssClassDirectivesEnabled is not a function errors.

Note: I'm running Angular 1.4.9

'use strict';

angular.module('app')
  .config(compilationConfig)
;

compilationConfig.$inject = ['$compileProvider'];

function compilationConfig($compileProvider) {
  $compileProvider.debugInfoEnabled(false);
  $compileProvider.commentDirectivesEnabled(false);
  $compileProvider.cssClassDirectivesEnabled(false);
}
like image 219
MattDionis Avatar asked Mar 10 '23 23:03

MattDionis


1 Answers

Solved this myself. This functionality was introduced in 1.6.0 so you need to upgrade to take advantage of these methods.

like image 86
MattDionis Avatar answered Apr 08 '23 21:04

MattDionis