
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
grunt-loopback-angular-addmodeldata
Advanced tools
Extends grunt-loopback-angular. auto-generating Angular $resource services for loopback will include model data for use at runtime on angular client
Extends grunt-loopback-angular. auto-generating Angular $resource services for loopback will include model data for use at runtime on angular client
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-loopback-angular-addmodeldata --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-loopback-angular-addmodeldata');
In your project's Gruntfile, add a section named loopback_angular_addModelData to the data object passed into grunt.initConfig().
Service.options shown are defaults so you can leave them off if using the same. Should look like
loopback_angular_addModelData: {
services: {
options: {
modelConfig: 'server/model-config.json',
serviceFile: 'client/app/scripts/lb-services.js',
modelDir: 'common/models/'
}
}
}
Register task as part of loopback command
grunt.registerTask('loopback', [
'loopback_angular',
'loopback_angular_addModelData', <-- Add this line
'docular'
]);
So what do you get for this? Now when you access loopback resources in angular you can get at the model info stored in the model.json file. As in
//Supposing you have exposed a customer model on your loopback api
function(Customer) {
//figure our what properties the customer model has at runtime
modelProps = Customer.model.properties;
}
I built this because I use angular-formly to automatically generate forms for editing models. By getting access to model properties at runtime and can build out the forms simply based on the fields defined in model.json
(Nothing yet)
FAQs
Extends grunt-loopback-angular. auto-generating Angular $resource services for loopback will include model data for use at runtime on angular client
We found that grunt-loopback-angular-addmodeldata 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.