Where to find 'angular-csp.css'

4,276 views
Skip to first unread message

a.biro

unread,
Oct 27, 2013, 7:06:58 PM10/27/13
to ang...@googlegroups.com
Hello,

I'm experiencing similar behavior to the issues described here: adding a single ngClick directive to my Chrome App's code while CSP is enabled results in an exception because of eval. 5 days ago there was a commit that changed the documentation of the ngCsp directive to state that to make certain directives work in CSP mode, one needs to include the angular-csp.css file manually. I just started learning Angular and I'm far from being familiar with it, but it I suspect that including the referenced CSS file will not solve my issue, since it seems to be intended to fix problems with ngCloak and ngShow/Hide. Yet I would like to try it, but I can't seem to get hold of the file. Could anyone please point me to it or to any other solution?

(Angular version: v1.2.0-rc.3, Chrome version: 30.0.1599.101)

Best regards,
A

OpenNota

unread,
Oct 27, 2013, 7:28:57 PM10/27/13
to ang...@googlegroups.com
If you uncomment the following line in the Gruntfile.js and then build angular, angular-csp.css will be created.
              //uncomment to enable CSP
              //util.csp(),

There's nothing magical in it, it's the same css that was included in the angular.js file earlier:

/* Include this file in your html if you are using the CSP mode. */
@charset "UTF-8";
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
.ng-cloak, .x-ng-cloak,
.ng-hide {
  display: none !important;
}
ng\:form {
  display: block;
}

I think it will not work by itself, you will need to build angular yourself and use this custom build instead of distributed one.

a.biro

unread,
Oct 27, 2013, 8:01:52 PM10/27/13
to ang...@googlegroups.com
Thanks for the quick answer! As you predicted, including simply the CSS did not solve the problem. Building custom Angular goes beyond my expertise and I'm more interested right now in learning the basics, so I think will just stick with the stable release, as CSP seems to work fine with that.

Andy Joslin

unread,
Oct 27, 2013, 8:34:49 PM10/27/13
to ang...@googlegroups.com
Have you tried the snapshot version? http://code.angularjs.org/snapshot/ - this is built and uploaded every time a commit is pushed to angularjs master.

Agost Biro

unread,
Oct 28, 2013, 3:51:57 AM10/28/13
to ang...@googlegroups.com
That's great, thanks! I did not know about the availability of a snapshot version.
Using AngularJS v1.2.0-f3e3a65 and including the 'angular-csp.css' file (which btw one can find here) did make CSP work. (Tbh this should've been obvious to me as the referenced documentation is for version 1.2.0-f3e3a65.)



On Mon, Oct 28, 2013 at 1:34 AM, Andy Joslin <andyt...@gmail.com> wrote:
Have you tried the snapshot version? http://code.angularjs.org/snapshot/ - this is built and uploaded every time a commit is pushed to angularjs master.

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/w00KgEi1DLk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages