Using inheritance for directives to access the parent controller.
Notice that it's also possible to implement this with a parent directive implementing the controller.
This example is similar to other I posted before but removes the use of $parent
Using inheritance for directives to access the parent controller.
Notice that it's also possible to implement this with a parent directive implementing the controller.
This example is similar to other I posted before but removes the use of $parent
This sample shows how to keep a top level model that states what blocks/ panels to display on the screen.
There are 2 different samples:
var app = angular.module('plunker', []); | |
app.controller('MainCtrl', function($scope) { | |
$scope.items = [ | |
{ID: '000001', Title: 'Chicago'}, | |
{ID: '000002', Title: 'New York'}, | |
{ID: '000003', Title: 'Washington'} | |
]; | |
/* Style a layer to display the console.log messages */ | |
#consolediv { | |
position: absolute; | |
top:0; | |
left:0; | |
bottom:0; | |
overflow: auto; | |
font-size: 10px; | |
color: #333; | |
width:200px; |