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

Typo error in module require #67

Closed
msuntharesan opened this issue May 23, 2014 · 5 comments
Closed

Typo error in module require #67

msuntharesan opened this issue May 23, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@msuntharesan
Copy link

There are typo error in src/datastore/sync_methods/digest.js and src/datastore/sync_methods/injectjs

should be var observe = require('observe-js') instead of var observe = require('observejs')

@jmdobry
Copy link
Member

jmdobry commented May 23, 2014

The browserify grunt task that builds angular-data creates an alias from lib/observe-js/observe-js to observejs.

Are you trying to require angular-data? If so, perhaps I need to drop the alias and use the raw path where I require('observejs') .

@msuntharesan
Copy link
Author

Yes I am trying to use require with browserify. Also It would be nice if the main file exports the module as well. That way i don't have to specify an expose to browserify
Right now I am using this with gulp and browserify

return browserify()
  .require('lodash')
  .require('angular/angular', {expose: 'angular'})
  .require('angular-cache/src', {expose:'angular-cache'})
  .require('angular-data/src', {expose:'angular-data'})
  .bundle({debug:!deploy})
  .pipe(source('lib.js'))
  .pipe(gulp.dest(dist('./')));

@jmdobry
Copy link
Member

jmdobry commented May 23, 2014

Okay, I've never tried requireing angular-data myself, so it would be great if you can tell me how to make angular-data requireable. I'm just not totally clear on how it works. I use browserify to build angular-data's many source files, not to bundle my own apps.

@msuntharesan
Copy link
Author

The snippet above was for creating a lib.js. for actually requiring I have browserify bundle as follows

return browserify('./app/bootstrap.js')
    .external('angular')
    .external('angular-data')
    .external('angular-cache')
    .bundle({debug:!deploy})
    .pipe(source('app.js'))
    .pipe(gulp.dest(dist('./')))

And in my bootstrap.js file

// from lib
require('angular');
require('angular-data');
require('angular-cache');
// my modules
require('./main');
require('./modules');
var app = angular.module('sb', ['sb.main', 'sb.modules', 'angular-data.DS', 'angular-data.DSCacheFactory'])
  .run(function() {
    console.log('App Initialized');
  });

jmdobry added a commit that referenced this issue May 23, 2014
@jmdobry
Copy link
Member

jmdobry commented May 23, 2014

@VanthiyaThevan Try requiring the dist/angular-data.js file in latest master.

@jmdobry jmdobry added this to the 0.10.0 milestone Jun 26, 2014
@jmdobry jmdobry self-assigned this Jun 26, 2014
@jmdobry jmdobry removed the question label Jun 26, 2014
@jmdobry jmdobry closed this as completed Jul 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants