JSFiddle - React, Tailwind, and code Playground

by fredrik

HTML

<div data-ng-app="test-app">
    <div data-ng-controller="CrmListController">
        <ul>
            <li data-ng-repeat="item in crmList">
                <a href="#/{{ item.id }}">{{ item.name }}</a>
            </li>                    
        </ul>
    </div>
    <div data-ng-controller="CrmDetailController">
        {{ test }}
    </div>
</div>

JavaScript

angular.module('test-app', [], function ($locationProvider) {

    $locationProvider.html5Mode(true);
});


function CrmListController ($scope) {
    $scope.crmList = [{ id: 1, name: 'item1'}, { id: 2, name: 'item2'}];
    
}

function CrmDetailController ($scope, $location) {
    $scope.test = 'Hello, earth!';
    
    $scope.$watch(function () {
        return $location.hash();            
    }, function () {
        $scope.test = $location.hash();
    });
}