Socket
Socket
Sign inDemoInstall

materia-server-client-assets

Package Overview
Dependencies
2
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    materia-server-client-assets

Materia Server Client Assets contains all the javascript and css for Materia Server and the Materia Widget Development Kit.


Version published
Weekly downloads
1
Maintainers
4
Created
Weekly downloads
 

Readme

Source

Materia Client Assets

This repository contains all the javascript and css needed for the Materia Server and some assets needed for the Materia Widget Development Kit.

Visit the Materia Documentation for more information.

Conventions and Guidelines

Angular

  • Each module is in it's own file, in a directory matching the type of module it is
  • use dashes to seperate words in file names
  • tests use the same name of the module they are testing (module.js and module.test.js)
  • file names start with the type of module it is: filter-, dir-, ctrl-, srv-
  • reusable code that has a wider scope then a single module is placed in a service module

Order of Code Angular Controllers

By convention, all controllers are written in a certain order from top to bottom:

  1. Variables and constants used in the controller
  2. Function defenitions, do define directly on $scope
  3. Expose variables and methods to $scope
  4. Initialize state
const app = angular.module('materia')
app.controller('peopleController', function($scope) {
	// define vars and consts
	let _people = []

	// define functions
	const _sortNames = (a, b) => `${a.first} ${a.last}`.localeCompare(`${b.first} ${b.last}`)

	const getPeople () => {
		// load users from some place
		_people.sort(_sortNames)
		$scope.people = _people
	}

	// Expose on scope
	$scope.people = []
	$scope.getPeople = getPeople

	// initialize
	getPeople()
})

FAQs

Last updated on 20 Dec 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc