New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lionjs

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lionjs

Lightweight model layer for Angular 1.x

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-61.54%
Maintainers
1
Weekly downloads
 
Created
Source

Circle CI

lionjs

Lightweight Model Layers for Angular 1.x

Usage

JSON Format

Required to start kick off the initial angular module

{
    "moduleName": "textForms",
    "form": {
        "firstName": {
            "type": "string",
            "validators": ["alphanum", {
                "min": 3
            }, {
                "max": 30
            }, "required"]
        }
    }
}

Bootstrap

Kick off LionjS

LionJS comes with a custom build of joi-browserify v0.0.5. You need to include this version of joi-browserify which is located in the dist folder. You can also import it separately from the repo above.

Using the bundled "joi-browserify"

require("node_modules/lionjs/dist/joi-browserify.min.js");
var modelConfig = require("modes.json!")
require("lion");
lion(modelConfig);

Then register the angular module, this is the name you supplied in the json file under 'moduleName'

angular.module("myApp", ["textForms"]);

Validation directives are named the same as your fields but with 'Validator' at the end firstName -> firstNameValidator

<input text="type" ng-model="name" first-name-validator/>
Bootstrap Example
<form name="lionForm">
  <label>
    First Name:
    <input type="text" ng-model="firstname" name="firstName" first-name-validator>
  </label>
  <div ng-messages="lionForm.firstName.$error" role="alert">
    <div ng-message="alphanum">You must have an alphanumeric name</div>
    <div ng-message="min">The min length is 3</div>
    <div ng-message="max">The max length is 30</div>
  </div>
</form>

Example Repos

Example Repo

Keywords

FAQs

Package last updated on 22 May 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc