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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

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


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


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.


  <body class="bg">
<div class="global-wrapper" ng-app="myApp">

  <!-- nav section -->
  <nav class="navbar navbar-default" ng-controller="navCtrl">
  <div class="container">
    <div class="row panel panel-primary" ng-controller="homeCtrl">
      <div class="panel-heading">
        <h2 class="panel-title">Menu</h2>

      <!--     food list   	 -->
      <div class="col-xs-5 panel-body">
        <ul class="list-group">
          <li class="list-group-item"> <h4>Catalogue:</h4>
            <input class="form-control" placeholder="Search a meal" type="text" ng-model="searchText">
            <contact class="list-group-item" ng-repeat="contact in contacts | orderBy: 'name' | filter: searchText "></contact>
      <!--   ng-view below       -->
      <div class="col-xs-7">
        <div class="list-group panel-body">
          <div ng-view></div>
      <!-- footer -->
      <div class="panel-heading">
        <div class="row text-center" id="footer"> <!-- for footer -->
      <div class="col-xs-6">
      <h5><a href="" target="_blank">Eleftheria</a> | <a href="" target="_blank">Projects</a> | <a href="" target="_blank"> Coding videos </a></h5>
      <!-- social media -->
      <div class="col-xs-6 text-primary">
        <a href="" target="_blank">
     <img src="" 
      style="text-align:center" alt="twitter"> 
         <a href="" target="_blank">
     <img src="" 
      style="text-align:center" alt="github"> 
        <a href="" target="_blank">
     <img src="" 
       style="text-align:center" alt="youtube"> 
    </div> <!-- end footer -->

    <!--  html templates used by angular, usually in separate files -->
    <script type="text/ng-template" id="default.html">
      <div class="alert alert-success text-center" ng-class="{hidden : !removed}"> {{removed}}</div>
      <div class="list-group-item text-center">Please select a meal to view</div>

	  <!-- 	template for displaying a contacts info	 -->
    <script type="text/ng-template" id="contact_info.html">
      <div class="list-group-item">
        <h3 class="text-center">{{}}</h3>
        <p>calories: <a ng-href="{{currentContact.calories}}">{{currentContact.calories}}</a></p>
        <p>ingredients: {{currentContact.ingredients}}</p>
        <p>more info: <a ng-href="{{currentContact.url}}">{{currentContact.url}}</a></p>
        <p><img ng-src="{{currentContact.img}}"></p>

<!--      template used for the ng-repeat in the contact list        -->
    <script type="text/ng-template" id="contact.html">
      <a ng-href="#/contact-info/{{contacts.indexOf(contact)}}">


                body {background-color: #fefefe}

#footer a:link{color:pink;}
#footer a:visited{color:tomato;}
#footer a:hover{color:yellowgreen;}

.bg { 
    /* The image used */
    background-image: url("");

    /* Full height */
    height: 100%; 

    /* Center and scale the image nicely */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;


                var myApp = angular.module('myApp', ['ngRoute'])

//ng-route config
.config(function ($routeProvider, $locationProvider){
    .when('/home', {
      templateUrl: 'default.html',
    .when('/contact-info/:contact_index', {
      templateUrl: 'contact_info.html',
      controller: 'contactInfoCtrl'
    .otherwise({redirectTo: '/home'});

// controllers
.controller('navCtrl', function ($scope) {
  $scope.nav = {
    navItems: ['home', 'add'],
    selectedIndex: 0,
    navClick: function ($index) {
      $scope.nav.selectedIndex = $index;

.controller('homeCtrl', function ($scope, ContactService){
  $scope.contacts = ContactService.getContacts();

.controller('contactInfoCtrl', function ($scope, $routeParams){
  var index = $routeParams.contact_index;
  $scope.currentContact = $scope.contacts[index];

// directives
.directive('contact', function () {
  return {
    restrict: 'E',
    replace: true,
    templateUrl: 'contact.html'

// services
.factory('ContactService', [function () {
  var factory = {};

  factory.getContacts = function () {
    return contactList;

  // contact list, usually would be a separate database
  var contactList = [
    {id: 0, name: 'Green Salad', calories: '200', ingredients: 'cucamber, brocoli', url: '', img: ''},
    {id: 1, name: 'Red meat', calories: '234', ingredients: 'red meat with sauce and potatoes', url: '', img: ''},
    {id: 2, name: 'Chicken', calories: '167', ingredients: 'chicken with rice', url: '', img: ''},
    {id: 3, name: 'Vegetable meatballs', calories: '94', ingredients: 'beans, corn, oats...', url: '', img: ''},
    {id: 4, name: 'Meatballs', calories: '104', ingredients: 'read meat', url: '', img: ''},
    {id: 5, name: 'Corn', calories: '50', ingredients: 'corn, salt', url: '', img: ''},
    {id: 6, name: 'Eggs', calories: '78', ingredients: 'eggs, olive oil, bread', url: '', img: ''},
    {id: 7, name: 'Kinoa', calories: '120', ingredients: 'kinoa, rice', url: '', img: ''},
    {id: 8, name: 'Tuna', calories: '213', ingredients: 'tuna with tomatoes', url: '', img: ''},
    {id: 9, name: 'Soup', calories: '167', ingredients: 'soup with chicken and potatoes', url: '', img: ''}
  return factory;