Giter VIP home page Giter VIP logo

angular-1.x-playground's Introduction

AngularModules

Some AngularJS modules, some in TypeScript

ngEnter

Press the Enter key to call a function on an input field.

<input type="text" ng-enter="doSomething()">

bbCode

Evaluate bbCode. Include bbCodeParser.js for parsing. Not all tags are supported but the most used ones like ul, b, i, u, left, right, quote, youtube, code, img and url.

$scope.textBBCode = "[b]bold[/b] [url=http://www.bbcode.org/]bbcode.org![/url]"
<p bbcode ng-bind="textBBCode"></p>

MessageCenter

Collect messages, warnings and info logs.

var myApp = angular.module('crmApp', ['messagecenter']);
 
myApp.controller("mainController", ["$scope", "sharedMessageService",
    ($scope, sharedMessageService) =>
        new Application.Controllers.mainController($scope, sharedMessageService)]);
export class mainController {
 
    constructor(private $scope:ImainControllerScope,
                private sharedMessageService:any)
    {
        sharedMessageService.broadcast("message: Foo.");
    }
}
<script type="text/javascript" src="/web/js/messagecenter.js"></script>
<messagecenter></messagecenter>

EditInPlace

Click on a label to change the model value it is displaying.

app.directive("editInPlace", [() => new Application.Directives.EditInPlace()]);
<edit-in-place value="model" property="propertyNameOfModel"></edit-in-place>

FocusElement

Whenever the bound variable changes its value the input is selected.

app.directive("setFocus", ["$parse", ($parse) => new Application.Directives.FocusElement($parse)]);```
<input set-focus="editing" type="text">

RefreshHTML

Directives are compiled by angular only once when viewing. This directives recompiles it if a variable changes to true ("use-boolean" switch) or a variable changes its value.

app.directive("refreshHtml", ["$compile", "$parse", ($compile, $parse) => new Application.Directives.RefreshHtml($compile, $parse)]);
<div refresh-html="refresh" use-boolean>
    <edit-in-place value="model" property="propertyNameOfModel"></edit-in-place>
</div>

StringToNumber

For some number inputs it's necessary to have a number for the model. If it is a string (for some reasons), the binding fails. This directive casts a string to a number.

app.directive("stringToNumber", [() => new Application.Directives.StringToNumber()]);
<input ng-model="controller.getOptionByName('user', 'NumberField_numberDetails').value" string-to-number type="number" class="form-control">

angular-1.x-playground's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.