DecebalICT

First {{ title }} not displayed, second is

Aug 18th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ### HTML
  2. <!DOCTYPE html>
  3. <html ng-app="plunker">
  4.  
  5.   <head>
  6.     <meta charset="utf-8" />
  7.     <script src="https://code.angularjs.org/1.4.4/angular.js"></script>
  8.     <script>document.write('<base href="' + document.location + '" />');</script>
  9.     <link rel="stylesheet" href="style.css" />
  10.     <script src="app.js"></script>
  11.     <title>{{ title }} dummy</title>
  12.   </head>
  13.  
  14.   <body data-ng-controller="SimpleController">
  15.     <h1>{{ title }}</h1>
  16.     <ul > 2015-08
  17.       <li data-ng-repeat="link in links">
  18.         <a href="{{ link.url }}" target="_blank">{{ link.desc }}</a>
  19.       </li>
  20.       <br />
  21.       <button ng-click="openAll()">open all</button>
  22.      </ul>
  23.   </body>
  24.  
  25. </html>
  26.  
  27. ### js
  28. angular.module('plunker', [])
  29.   .controller('SimpleController', function SimpleController($scope,$window) {
  30.       $scope.title = 'Published Photo\'s';
  31.       $scope.links = [
  32.           { desc: 'Album',            url: 'https://plus.google.com/collection/MuwPX' },
  33.           { desc: 'Heron Sunbathing', url: 'https://plus.google.com/+CecilWesterhof/posts/bHvSzBGobEj' },
  34.           { desc: 'Heron Fishing',    url: 'https://plus.google.com/+CecilWesterhof/posts/TY3asc5oCnB' },
  35.           { desc: 'Water Lily',       url: 'https://plus.google.com/+CecilWesterhof/posts/AtTwhL8SdnH' },
  36.           { desc: 'Tree at Pond',     url: 'https://plus.google.com/+CecilWesterhof/posts/TyiZbUWdnrm' },
  37.           { desc: 'Fish',             url: 'https://plus.google.com/+CecilWesterhof/posts/MoQ7vXs8HqP' },
  38.           { desc: 'Fountain',         url: 'https://plus.google.com/+CecilWesterhof/posts/BDYkPKSMUwZ' },
  39.           { desc: 'Digitalis',        url: 'https://plus.google.com/+CecilWesterhof/posts/ed3ZGNzb8kM' },
  40.           { desc: 'Sunset',           url: 'https://plus.google.com/+CecilWesterhof/posts/DPbHHSFXBY4' },
  41.           { desc: 'Digitalis 2',      url: 'https://plus.google.com/+CecilWesterhof/posts/ZZtSUwNb6RC' },
  42.           { desc: 'Water Lilies',     url: 'https://plus.google.com/+CecilWesterhof/posts/LY62DqLEJhG' },
  43.           { desc: 'Flower',           url: 'https://plus.google.com/+CecilWesterhof/posts/XFKyTcoakcy' },
  44.           { desc: 'Waterfalls',       url: 'https://plus.google.com/+CecilWesterhof/posts/bfg5irDAn2T' },
  45.           { desc: 'Frogs',            url: 'https://plus.google.com/+CecilWesterhof/posts/jKr5B6EQyo1' },
  46.           { desc: 'Flowers',          url: 'https://plus.google.com/+CecilWesterhof/posts/iPQbBrTbcnm' },
  47.           { desc: 'Sheep',            url: 'https://plus.google.com/+CecilWesterhof/posts/3a2mBo7om4H' },
  48.           { desc: 'Beetle',           url: 'https://plus.google.com/+CecilWesterhof/posts/KnNtis2Gqxf' },
  49.           { desc: 'Dove',             url: 'https://plus.google.com/+CecilWesterhof/posts/XA5RcC2Cxbv' },
  50.           { desc: 'City Walk',        url: 'https://plus.google.com/+CecilWesterhof/posts/R9me9AKQC6n' },
  51.           { desc: 'Boar',             url: 'https://plus.google.com/+CecilWesterhof/posts/9bfpBiQPYen' },
  52.           { desc: 'Bird',             url: 'https://plus.google.com/+CecilWesterhof/posts/X6gFE3oxXLY' },
  53.           { desc: 'Goose',            url: 'https://plus.google.com/+CecilWesterhof/posts/H4w6JvnQkcU' },
  54.       ];
  55.       $scope.openAll = function(){
  56.           $scope.links.forEach(function(link){
  57.               console.log(link)
  58.               $window.open(link.url,"_blank")
  59.           })
  60.       }
  61.   })
Advertisement
Add Comment
Please, Sign In to add comment