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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <script type="text/javascript" src="//"></script>
<script type="text/javascript" src="//"></script>
<script src="//"></script>
<link type="text/css" rel="stylesheet" href="//" />
<link type="text/css" rel="stylesheet" href="//" />

<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="{{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.users[ state.selectedUserIndex ] );

		$ = 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 );