cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              <script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="//golden-layout.com/assets/js/goldenlayout.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
<link type="text/css" rel="stylesheet" href="//golden-layout.com/assets/css/goldenlayout-base.css" />
<link type="text/css" rel="stylesheet" href="//golden-layout.com/assets/css/goldenlayout-dark-theme.css" />

<template type="text/html" id="userlistTemplate">
  <ul ng-controller="userlistController" class="userlist">
    <li ng-repeat="user in users" 
        ng-click="select( user )"

	<template type="text/html" id="userDetailTemplate">
    <div ng-controller="userdetailsController" class="userdetails">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/152047/{{user.img}}" width="100" height="100" />
              .userlist *,
	color: #fff;
	font: 12px Arial, sans-serif;
	margin: 0;
	padding: 0;
.userlist li{
	padding: 10px;
	border-bottom: 1px solid #555;
	cursor: pointer;
	list-style-type: none;

.userlist li:hover{
	background: #666;

.userlist li.selected{
	background: orange;
	font-weight: bold;

	padding: 10px;
	overflow: hidden;

.userdetails img{
	float: left;
	margin-right: 10px;

.userdetails h2{
	margin-top: 0;
              angular.module('userlist', [] )
	.controller('userlistController', function( $scope, $timeout, container, state ) {

		var selectedUser = {};

		$scope.users = [
			{ name: 'Jackson Turner', street: '217 Tawny End', img: 'men_1.jpg' },
			{ name: 'Megan Perry', street: '77 Burning Ramp', img: 'women_1.jpg' },
			{ name: 'Ryan Harris', street: '12 Hazy Apple Route', img: 'men_2.jpg' },
			{ name: 'Jennifer Edwards', street: '33 Maple Drive', img: 'women_2.jpg' },
			{ name: 'Noah Jenkins', street: '423 Indian Pond Cape', img: 'men_3.jpg' }

			$scope.select( $scope.users[ state.selectedUserIndex ] );

		$scope.select = function( user ) {
			selectedUser.isSelected = false;
			user.isSelected = true;
			selectedUser = user;
			container.extendState({ selectedUserIndex: $scope.users.indexOf( user ) });
			container.layoutManager.eventHub.emit( 'userSelected', user );

angular.module('userdetails', [] )
	.controller('userdetailsController', function( $scope, container, state ) {
		$scope.user = state.user || null;

		container.layoutManager.eventHub.on( 'userSelected', function( user ){
			$scope.user = user;
			container.extendState({ user: user });

var AngularModuleComponent = function( container, state ) {
	var html = $( '#' + state.templateId ).html(),
		element = container.getElement();
	element.html( html );

		.module( state.module )
		.value( 'container', container )
		.value( 'state', state );

	angular.bootstrap( element[ 0 ], [ state.module ] );

var myLayout = new GoldenLayout({
		type: 'row',
		content: [{
			width: 20,
			title: 'Registered Users',
			type: 'component',
			componentName: 'angularModule',
			componentState: {
				module: 'userlist',
				templateId: 'userlistTemplate',
				selectedUserIndex: 2
			type: 'component',
			title: 'Selected User',
			componentName: 'angularModule',
			componentState: {
				module: 'userdetails',
				templateId: 'userDetailTemplate'

myLayout.registerComponent( 'angularModule', AngularModuleComponent );
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................