Famous/famous-angular

famous-angular with requirejs can't find famous

systembugtj opened this issue · 6 comments

I use the famous-angular with requirejs with below config. Also I try the famous.js not the global one, still not working, always got angular exception famous is undefined.

So I need to include the famous.js in to allow it work. I'm not very familiar with famous, is there a way to put famous-angular work with requirejs?

paths: {
'famous' : 'vendor/famous/dist/famous-global',
'famous-angular' : 'vendor/famous-angular/dist/famous-angular',
},
shim : {
'famous' : {
exports : 'famous'
},
'famous-angular' : {
deps: ['angular', 'famous'],
},
},

I think the more important question is how are you planning to use requirejs with angular?

Not that it's impossible, but if you are just beginning, you are going about it way wrong. Take a look at the famous-angular-examples and build from there.

Hi -

We do not support RequireJS and personally I would not implement famous-angular that way. The closest you will probably get for support on this topic is confirming what files should be used. You need angular.js, famous-global.js, and famous-angular.js Take a look at this CodePen if you need an example of a working app.

Thanks,

Jordan

@systembugtj I disagree with @jordanpapaleo. We use Angular very successfully with Require.js and wrap every Angular module we create in a define function so we can inject external dependencies into our directives, services, providers, that is for everything except for famous. With famous/angular, we reference all famo.us methods using the included $famous provider. When writing custom Famous modules, we reference famous-global.js in that specific module and then inject the module with Require.js into our Angular directives and so forth. I've considered releasing a boilerplate in the future that uses this convention, would that be something that is wanted?

For a great tutorial on how to structure an Angular app with Require, visit http://solutionoptimist.com/2013/09/30/requirejs-angularjs-dependency-injection/

@steveblue we use a similar method to the one you have described. +1 for releasing a boilerplate though, then we have the best of both worlds.

@matt-d-rat i've gone ahead and made a famous angular boilerplate that uses require for external dependency injection available on github. This boilerplate takes a lot of ideas from Thomas Burleson and maintains a clearly readable folder structure. I've also included a small library for handling responsive within a web app, with breakpoints mirrored in SASS. At some point, I'll add support for Grunt (as it only builds with Gulp currently), LESS and a few other options. If anyone wants to contribute to the project, just contact me. https://github.com/steveblue/fa-boilerplate

For those of you still looking for the issue. You can just solve it by including famous-global.js somewhere in your HTML.