carylandholt / gulp-ng-classify Goto Github PK
View Code? Open in Web Editor NEWConvert CoffeeScript classes to AngularJS modules with ng-classify
License: MIT License
Convert CoffeeScript classes to AngularJS modules with ng-classify
License: MIT License
I have what I believe to be the basic set up, and I am not getting it to compile.
var gulp = require('gulp');
var ngClassify = require('gulp-ng-classify');
var paths = {coffee : './coffee/**/*.coffee'};
gulp.task('coffee', function () {
gulp.src(paths.coffee)
.pipe(ngClassify())
.on('error', gutil.log)
.pipe(gulp.dest('./www/js'));
});
gulp.task('watch', function () {
gulp.watch(paths.coffee, ['coffee']);
});
I am getting the following error:
TypeError: Cannot call method 'forEach' of undefined
When I try to update:
class Timer extends Controller
constructor:
@$inject: ['$scope', '$timeout']
elapsedTime : 'timer'
I don't know what could be wrong. It would be great to actually see a demo angular project with a functioning ng-classify. Any thoughts?
It seems that options parameter is not recognized:
pipe(ngClassify({appName:'xxxx'})) produces angular.module('app') versus angular.module('xxxx')
Using version 4.0.1, the error object do not seem to contain the filename as documented in the 4.0.1 release :
{ [SyntaxError: unmatched OUTDENT]
plugin: 'gulp-ng-classify',
showStack: false,
name: 'SyntaxError',
message: 'unmatched OUTDENT',
stack: '[stdin]:33:6: error: unmatched OUTDENT\n }\u001b[1;31m\u001b[0m\n\u001b[1;31m ^\u001b[0m' }
Hi! I am getting an error using this module. After installing it node/gulp can't find it. You can try to reproduce this issue by the following:
$ mkdir test && cd test
$ npm install gulp-ng-classify
$ touch app.js
app.js:
var ngClassify = require('gulp-ng-classify');
$ node app.js
A wild error occurred:
module.js:340
throw err;
^
Error: Cannot find module 'gulp-ng-classify'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/0xsven/Dev/angular/test/app.js:1:80)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
Is this a bug? Or am I doing it wrong?
Hi, is there any way to make the following:
base.coffee
class Base extends Controller
showAlert: ->
alert 'show'
home.coffee
class Home extends Base
If I run above code it says that Base is not found, because it's not a global, how can do this to work?
Hello, is this still maintained repo?
I have very old project and updated CoffeeScript to gulp-coffee: ^3.0
. This brings main difference to coffee: now it's classes instead of functions.
This is our source:
class AppConstant extends Constant
constructor: ->
return {
API_CLIENT: 'admin_site'
}
compiles into
var AppConstant;
AppConstant = class AppConstant {
constructor() {
return {
API_CLIENT: 'admin_site'
};
}
};
angular.module('app.core').constant('AppConstant', AppConstant());
and in browser (FireFox 120.0) throw error TypeError: class constructors must be invoked with 'new'
Is there anything I can do to fix this?
We define more than one modules in our application, like 'app', 'app.common' and so on. It would be really good if we could have full control over it in the code.
Something like:
-->
angular.module('app.common', []).controller('HomeController', ...)
angular.module('app', ['app.common'])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.