JSFiddle - React, Tailwind, and code Playground

by flexin

HTML

<div ng-controller="ObjectController as o">
    <ul>
        <li ng-repeat="attr in o.attributes">
            {{attr.name}}
        </li>
    </ul>
    test content
</div>

JavaScript

(function() {

    // let's define our module
    angular.module('denja', ['ngRoute'])
    .factory('ObjectService', ['$interval', function($interval) {
        var d = {
            attr: [
                {name: 'name', type:'text'},
                {name: 'firstname', type: 'text'}
                ],
            view: 'list',
            objects: [
                {
                    id: 1,
                    name: {v: 'Heremans', tv: 'Heremans'},
                    firstname: {v: 'David', tv: 'David'}
                },
                {
                    id: 2,
                    name: {v: 'Vincke', tv: 'Vincke'},
                    firstname: {v: 'Ellen', tv: 'Ellen'}
                }
                ]
        }
        
        
        
        return d;
    }])
    .controller('ObjectController', ['$scope', 'ObjectService',                 
        function($scope, ObjectService) {
            this.attributes = ObjectService.attr;
            this.data = ObjectService.data;
            
            console.debug(this.attributes);
        
        }]);
                               
    
})();