XKE 2013.10.22 Scope inheritance (full)

by Mike Kotsur

HTML

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.js"></script>
<div>
    <h3>I'm in {{city}}</h3>
    <input ng-model="city" />
</div>

CSS

div[ng-controller="firstCtrl"] {
    background-color: blue;
    height: 300px;
    width: 500px;
    color: yellow;
}

div[ng-controller="secondCtrl"] {
    background-color: grey;
    height: 200px;
    width: 300px;
    color: black;
    margin-left: 100px;
}

CoffeeScript

demo = angular.module 'demo', []
    
angular.bootstrap document, ['demo']