![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
angular-scaffold
Advanced tools
Angular Scaffold is a collection of convenience wrappers around angular-model collections.
Angular Scaffold is a collection of convenience wrappers around angular-model collections.
Install the test runner with npm:
npm install
You can then run the tests with Gulp:
gulp
You can run coverage with:
gulp coverage
See /docs/api.md in this project for detailed documentation of all angular-scaffold's functions.
Your API must:
$links
collection containing a self
key, e.g.:[
{
"$links": {
"self": {
"href": "/api/posts/postaa"
}
},
"_id":"posta",
"name":"Post A",
"body":"Some content for Post A"
}
]
In your AngularJS application, include the JavaScript:
// your specific paths may vary
<script src="node_modules/radify/angular-model.js"></script>
<script src="node_modules/radify/angular-scaffold.js"></script>
In your app configuration, state a dependency on Angular Model and Angular Scaffold:
angular.module('myApp', [
'ur.model',
'ur.scaffold'
]);
Example controller using Angular Scaffold:
.controller('PostsController', function($scope, scaffold) {
angular.extend($scope, {
posts: scaffold('Posts', {})
});
})
An example application is included in this repository. It has a very simple API that illustrates a basic use case for angular-scaffold.
To install and run the sample project:
cd sample-project
npm install
node server.js
You can then browse to http://localhost:4730/ and add/remove Post objects from a list. angular-scaffold takes care of talking to the API for you.
angular-scaffold can paginate your model. Your API will need to support the Range: resources=n-n
header to take advantage of this. For example, Range: resources=10-20
would return resources 10 through 20.
scaffold('Shares', {
paginate: { size: 20, page: 1, strategy: 'paged' }
});
You can pass a specific query in, which will be sent through to the API. Your API will have to know how to respond to this.
scaffold('Comments', {
query: {
offline: $scope.selected._id
}
});
You can also pass in an ordering parameter. Again, your API will have to know what to do with it.
return scaffold('Shares', {
query: { to: true, order: { _id: 'desc'} }
});
[0.3.2] - 2015-11-30
package.json
description fieldFAQs
Angular Scaffold is a collection of convenience wrappers around angular-model collections.
The npm package angular-scaffold receives a total of 2 weekly downloads. As such, angular-scaffold popularity was classified as not popular.
We found that angular-scaffold demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.