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

TypeError: Cannot set property '$$templates' of undefined #55

Closed
cfpperche opened this issue Nov 9, 2014 · 9 comments
Closed

TypeError: Cannot set property '$$templates' of undefined #55

cfpperche opened this issue Nov 9, 2014 · 9 comments

Comments

@ncuillery
Copy link
Owner

Hi,

Which version of angular-breadcrumb do you use please ?

@dmglab
Copy link

dmglab commented Dec 2, 2014

I have the same issue. I'm using angularjs 1.3.4, angular-ui-router 0.2.13 and angular-breadcrumb 0.3.2

@dmglab
Copy link

dmglab commented Dec 2, 2014

Okay, this is a serious "security" problem. your code isn't compatible with "use strict" behavior. unfortunately Grunt does not bug you, when you run the jshint task - even if you set "use strict".

@ncuillery
Copy link
Owner

Thanks for these enlightenments, I'll investigate that.

@mgoldsborough
Copy link

Getting the same issue when I try to run after I combine and minify all of my css/js. Using angularjs 1.3.2 and angular-breadcrumb 0.3.2. Running locally works just fine.

@dmglab
Copy link

dmglab commented Dec 11, 2014

It's the same problem anyway. Take a look inside your minified is an search
for 'use strict'
Am 11.12.2014 07:19 schrieb "Mathew Goldsborough" <notifications@github.com

:

Getting the same issue when I try to run after I combine and minify all of
my css/js. Using angularjs 1.3.2 and angular-breadcrumb 0.3.2.


Reply to this email directly or view it on GitHub
#55 (comment)
.

ncuillery added a commit that referenced this issue Dec 14, 2014
@ncuillery
Copy link
Owner

I tested angular-breadcrumb with a fresh yeoman generation here and I didn't reproduce the bug, even with minified script ( http://ncuillery.github.io/angular-breadcrumb-issue-55/dist/#/main ).

I think I blindly fixed the bug by defining $$templates with var and adding 'use script;' in the source file.

@ebugfix, @dmglab or @mgoldsborough please can you checkout the issue-55 branch and tell me if the file dist/angular-breadcrumb.js fix the bug ? (if you use Bower: bower install angular-breadcrumb#issue-55)

Thanks for your help !

@dmglab
Copy link

dmglab commented Dec 15, 2014

Yes, that made it. In strict mode, every variable needs to be declared before using it.

I recommend you to read how strict mode works and what it does. Using strict mode in your javascript libraries provides many security benefits for code and client.

This article has a good overview to the "use strict" behavior.

Greetings!

@ncuillery
Copy link
Owner

Merge in master and released in 0.3.3

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

4 participants