Closed idoo closed 9 years ago
The API is different in 1.x, you can either add the controller methods to the methods object (as seen on http://davej.github.io/angular-classy/) or use the classy-compat
plugin: https://github.com/davej/classy-compat
Although... the errors in your console indicate that you haven't added Classy to your app.
Please ensure that the script is after the angular script and that the path is correct, e.g.
<script src="bower_components/angular-classy/angular-classy.min.js"></script>
And that you have added classy to your modules
var app = angular.module('app', ['classy']);
@davej i add classy (you can see in first post) i define app
@Application = angular.module 'Application', [
'classy'
'ui.router'
]
@Application
(this.Application
) is not necessarily the same as Application
, it depends on the function context in which it is created and whether or not you are using strict mode ("use strict";
) javascript.
If you can give me access to the page where this error is occurring, or recreate this in plunker/jsbin then I could have a look, otherwise it's difficult to debug just from a few lines of code.
It is probably safer (less context dependent) to use window.Application = angular.module 'Application', ['classy', 'router']
by the way.
@davej sorry, i can't give access for you :( i tried use window.Application and Application — no luck :(
Ok, I can't really help if I can't recreate the issue unfortunately. There is not enough info for me to help you debug this issue. Sorry.
@davej when i stop app, Application has only .classyController property, not .classy maybe it's help understand what is wrong?
That sounds like a very old version of Classy (maybe 0.3). Can you make sure that you are using the correct angular-classy JS file as found in the latest release https://github.com/davej/angular-classy/releases/tag/v1.1.0
@davej :+1: i get from rails-assets, when i change version from zip - work correctly!
After update i have trouble
i define app
and controller
and call from layout
Result: