JSFiddle

  • Angular: Using fake backend #350 is the latest revision

    http://angularjs.org/

    var app = angular.module('myApp', ['ngMockE2E']);
    
    // define our fake backend
    app.run(function($httpBackend) {
    
      var phones = [{name: 'phone1'}, {name: 'phone2 ...
  • Route Templates in Angular #287 is the latest revision

    A starting point for using route templates on jsFiddle.

    var app = angular.module( "myApp", [] );
    
    app.config( function ( $routeProvider ) {
      $routeProvider
        .when( '/this', { templateUrl: 'this.html' } )
        .when( '/that', { templateUrl: 'that.html ...
  • Angular Edit-in-Place Directive #860 is the latest revision

    AngularJS 1.0.3, HTML, CSS, JavaScript

    var app = angular.module( 'myApp', [] );
    
    app.directive( 'editInPlace', function() {
      return {
        restrict: 'E',
        scope: { value: '=' },
        template: '<span ng-click="edit()" ng-bind="value"></span><input ng-model="value"></input>',
        link: function ( $scope, element, attrs ...
  • Angular: Tag Directive #332 is the latest revision

    An AngularJS directive for tag management.

    var app = angular.module('myApp',[]);
    
    app.directive('tagManager', function() {
        return {
            restrict: 'E',
            scope: { tags: '=' },
            template:
                '<div class="tags">' +
                    '<a ng-repeat="(idx, tag) in tags" class="tag" ng-click="remove(idx)">{{tag}}</a>' +
                '</div>' +
                '<input type="text" placeholder="Add a tag..." ng-model="new_value"></input> ' +
                '<a class="btn" ng-click="add()">Add</a>',
            link: function ( $scope ...
  • Angular: Passing Object to Directive #4167 is the latest revision

    http://angularjs.org/

    var myApp = angular.module('myApp',[]);
    
    myApp.directive('passObject', function() {
        return {
            restrict: 'E',
            scope: { obj: '=' },
            template: '<div>Hello, {{obj.prop}}!</div>'
        };
    });
    
    myApp.controller ...
  • Angular: Empty Fiddle #31532 is the latest revision

    http://angularjs.org/

    var myApp = angular.module('myApp',[]);
    
    //myApp.directive('myDirective', function() {});
    //myApp.factory('myService', function() {});
    
    function MyCtrl($scope) {
        $scope.name = 'Superhero';
    }