
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
nodulator-angular
Advanced tools
AngularJS implementation and facilities for Nodulator.
Needs:
Provides class for angular
's directives, services, controllers and factories.
Allow inheritance of angular
behaviour, and automatic link between services and Nodulator.Resources
thanks to Nodulator-Socket
(socket-io)
angular
functionsSocket-io
implementation for angular
Nodulator.ResourceService
to link Nodulator.Resource
to angular
as a serviceng-app="app"
to body
tagYou can automaticaly install Nodulator
, Nodulator-Angular
and every dependencies by running
$> sudo npm install -g Nodulator
$> Nodulator install angular
Or you can just run npm
:
$> npm install nodulator nodulator-assets nodulator-socket nodulator-angular
Nodulator = require 'nodulator'
Socket = require 'nodulator-socket'
Assets = require 'nodulator-assets'
Angular = require 'nodulator-angular'
# Default config, can be omited
Nodulator.Config
servicesPath: '/client/services'
directivesPath: '/client/directives'
controllersPath: '/client/controllers'
factoriesPath: '/client/factories'
templatesPath: '/client/views'
# Required for Angular module to work
Nodulator.Use Socket
Nodulator.Use Assets
Nodulator.Use Angular
Nodulator.Run()
When main page is loaded, main Nodulator
scripts adds ng-app="app"
to body
tag in order to initialize angular
application.
Services can be created easely. First Nodulator.Service()
argument is the service name.
Nodulator will append 'Service' at the end of this name.
For a service name 'test', its real name will be 'testService'
Latter arguments are for dependency injection. Each one will be added to class :
class TestService extends Nodulator.Service 'test', '$http'
Test: ->
console.log 'Test'
@$http.get(...);
#Init only if you want to actualy create the service.
#Omit if you only want to inherit from it.
TestService.Init()
For the moment, every directive is {restrict: 'E'}
, and cannot be manualy configurated. (Except if you want to override Directive._Body()
behaviour)
Again, first argument is the directive name, and the latters are for dependencies injections.
For directive test
, it will look for template in config.viewPath
for file of same name (test.jade
for exemple)
The context of the class will be attached to angular
scope
. This way, the following directive...
class TestDirective extends Nodulator.Directive 'test', 'testService'
lol: 'mdr'
Lol: ->
@lol = 'lol'
@testService.Test()
TestDirective.Init()
... become ...
app.directive 'test', ['testService', (testService) ->
return {
restrict: 'E'
templateUrl: 'test-tpl'
link: (scope, element, attrs) ->
scope.testService = testService
scope.lol = 'mdr'
scope.Lol = ->
scope.lol = 'lol'
scope.testService.Test()
}
]
Nice uh ?
Beware, don't put to many things in your sister the injections, they will be in the scope !
You can also use compile
instead of link
by defining a @Pre()
and/or a @Post()
method.
class TestDirective extends Nodulator.Directive 'test'
Pre: ->
@name = 'test'
Post: ->
@value = ''
@test = ->
@value = 'lol'
TestDirective.Init()
Just as Services, factories are easy to declare :
class TestFactory extends Nodulator.Factory 'test', '$http'
Test: ->
console.log 'Test'
@$http.get(...);
TestFactory.Init()
Controllers are not implemented now (Houuuu !)
A socket is a Nodulator.Factory
implementing Socket.io
For the moment, a socket is always instanciated in each project. Future configuration will be disponible.
A socket has 2 methods : @On()
and @Emit()
, and apply changes to scope automaticaly.
A Nodulator.ResourceService
inherits from Nodulator.Service
and inject automatically $http
and socket
.
Also, it binds the socket to listen to the server Resource
with the same name.
It provides 5 methods :
class TestService extends Nodulator.ResourceService 'test'
OnNew: (item) ->
# Called when a new resource instance is created
OnUpdate: (item) ->
# When a resource instance is updated
OnDelete: (item) ->
# When a resource is deleted
List: (done) ->
# Put every records in @list
Fetch: (id, done) ->
# Fetch particular model and put it in @current
Delete: (id, done) ->
Add: (blob, done) ->
Update: (blob, done) ->
By calling $> Nodulator init
with this module installed,
It creates the following structure if non-existant:
client
āāā controllers
āāā directives
āāā factories
āāā index.coffee
āāā services
āāā views
And it gets AngularJS
from official website and puts it in /client/public/js
angular
object ($http, $rootScope,...) to local directive scope
07/01/15: v0.0.9
03/01/15: v0.0.8
02/01/15: v0.0.7
exemples/todo
02/01/15: v0.0.6
ng-app="app"
to body
tagNodulator-Assets
changeFAQs
Angular module for Nodulator
The npm package nodulator-angular receives a total of 10 weekly downloads. As such, nodulator-angular popularity was classified as not popular.
We found that nodulator-angular demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.