
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
angular-bind-querystring
Advanced tools
Two way binding between scope variables and URL querystring with default values
Two way binding between scope variables and URL querystring with default values.
Angular is a peer-dependency of this project so you need to install it separately.
npm install --save angular-bind-querystring
bower install --save angular-bind-querystring
Add the dist/angular-bind-querystring.min.js to your HTML file.
Add bindQuerystring module as a dependency of your Angular app:
angular.module('yourModule', ['bindQuerystring']);
angular.module('yourModule').controller(function($scope, bindQuerystring) {
var target = {};
bindQuerystring({
target: target,
properties: ['foo']
});
});
Then every change on URL querystring or the target object (given the selected properties) will be reflected in both.
You can send a parser and/or a formatter function to handle the value serialization:
angular.module('yourModule').controller(function($scope, bindQuerystring) {
var target = {};
bindQuerystring({
target: target,
properties: ['foo'],
parser: function(value, property) {
// parse value from querystring to scope property
return parseInt(value);
},
formatter: function(value, property) {
// formats value from scope property to querystring
return '' + value;
}
});
});
Parsers and formatters receive the actual value and the name of the property being transformed.
target - the object that holds the properties being boundproperties - an array of strings naming the properties that should be boundscope (optional) - isn't required, but prevents memory leak over timeparser (optional) - function that converts the URL query string to your modelformatter (optional) - function that converts your model to the URL query stringAny help is appreciated, feel free to open issues and submit pull requests.
FAQs
Two way binding between scope variables and URL querystring with default values
We found that angular-bind-querystring 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.