Support for AngularJS Modules

55 views
Skip to first unread message

Marc

unread,
Dec 30, 2012, 10:23:55 AM12/30/12
to script...@googlegroups.com
It would seem Scripted can't follow the (proprietary) concept of modules in AngularJS.

var app = angular.module('Music', [])

.factory('MusicSVC', function() {
  return {
    albumsByArtist: function(artist) {
      // Logic here...
    }
  };
})

.controller('MyCtrl', function($scope, MusicSVC) {
  // Know about MusicSVC.albumsByArtist() here...
});

Is that something that could be supported? If not, what options are there for helping it's inferring?

Andrew Eisenberg

unread,
Dec 30, 2012, 12:02:59 PM12/30/12
to Marc, script...@googlegroups.com
After a brief look at how the AngulaJS module system works, it doesn't
look too difficult to bring this into scripted. But one thing we are
facing is that there are so many module systems out there. It would
be nice to be able to move to something that is pluggable. Where
scripted extenders can plug in their own module systems. Right now,
scripted is not architected in that way and all support for module
systems need to be hand crafted (which is why we support only 2.5 (the
0.5 being global modules)). Module systems will need to plug into
both the client (to determine what the shape of the module is and
where it gets plugged in) as well as for the server (to determine how
to resolve them). Neither of which are trivial to do.

If we don't move to pluggability, which is likely, we will have to be
choosy about which module systems to focus on. General popularity of
the system as well as its overall technical merits will play a part in
this. So, overall, we still need to make some decisions here and your
input in this area is useful.
> --
>
>

Brian Bonner

unread,
Feb 27, 2013, 10:45:47 PM2/27/13
to script...@googlegroups.com
+1
Reply all
Reply to author
Forward
0 new messages