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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

  <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;

🕑 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.