Angular 01 - MVC Arcitechure

Learning Angular via Lynda

by Susan Delgado

HTML

<script src="https://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-app="myApp">
    
    <div class="main" ng-controller="MyController">
        <ul class="artistlist">
            <li class="artist cf" ng-repeat="item in artists">
                <img ng-src="{{item.shortname}}" alt="{{item.name}}" />
                <div class="info">
                <h2>{{item.name}}</h2>
                <h3>{{item.reknown}}</h3>
              </div>
            </li>
        </ul>
    </div>

</div>

CSS

/* @override 
  http://planetoftheweb.com/_/css/styles.css */

/* Reset Styles */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  font-size: 100%;
  vertical-align: baseline; }

html {
  line-height: 1; }

ol, ul {
  list-style: none; }

table {
  border-collapse: collapse;
  border-spacing: 0; }

caption, th, td {
  text-align: left;
  font-weight: normal;
  vertical-align: middle; }

q, blockquote {
  quotes: none; }

  q:before, q:after, blockquote:before, blockquote:after {
    content: "";
    content: none; }

a img {
  border: none; }

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
  display: block; }

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box; }


/* Base Styles */

.cf:before,
.cf:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.cf:after {
    clear: both;
}

html {
  background-color: #023E54; 
  background-image: url(images/fallback-gradient.png); 
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#023E54), to(#10AAC0));
  background-image: -webkit-linear-gradient(top, #023E54, #10AAC0); 
  background-image: -moz-linear-gradient(top, #023E54, #10AAC0);
  background-image: -o-linear-gradient(top, #023E54, #10AAC0);
  min-height: 100%;
  height: auto;
}

body  {
  font-family: Merriweather, serif;
  font-size: 1rem;
  line-height: 160%;
  *zoom: 1;
}


h1, h2, h3, h4, h5, h6 {
  font-family: 'Bree Serif', serif;
 ...

JavaScript

//Name spacing
var myApp = angular.module('myApp', []);

myApp.controller('MyController',

function MyController($scope) {
  
    $scope.artists = [{
        "name": "Barot Bellingham",
            "shortname": "http://lorempixel.com/400/200/",
            "reknown": "Royal Academy of Painting and Sculpture",
            "bio": "Barot has just finished his final year at The Royal Academy of Painting and Sculpture, where he excelled in glass etching paintings and portraiture. Hailed as one of the most diverse artists of his generation, Barot is equally as skilled with watercolors as he is with oils, and is just as well-balanced in different subject areas. Barot's collection entitled \"The Un-Collection\" will adorn the walls of Gilbert Hall, depicting his range of skills and sensibilities - all of them, uniquely Barot, yet undeniably different"
    }, {
        "name": "Jonathan G. Ferrar II",
            "shortname": "http://lorempixel.com/400/200/",
            "reknown": "Artist to Watch in 2012",
            "bio": "The Artist to Watch in 2012 by the London Review, Johnathan has already sold one of the highest priced-commissions paid to an art student, ever on record. The piece, entitled Gratitude Resort, a work in oil and mixed media, was sold for $750,000 and Jonathan donated all the proceeds to Art for Peace, an organization that provides college art scholarships for creative children in developing nations"
    }, {
        "name": "Hillary Hewitt Goldwynn-Post",
            "shortname": "http://lorempixel.com/400/200/",
            "reknown": "New York University",
            "bio": "Hillary is a sophomore art sculpture student at New York University, and has already won all the major international prizes for new sculptors, including the Divinity Circle, the International Sculptor's Medal, and the Academy of Paris Award. Hillary's CAC exhibit features 25 abstract watercolor paintings that contain only water images including waves, deep sea, and river."
  ...