Prev Demo
AngularJS
>
Isolating Scope Of Directive
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" /> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> </head> <body> <script> var app = angular.module("app", []); app.controller("CustomDirectiveIsolateScope", function ($scope) { $scope.Member = { username: 'Sheo', address: 'Hyderabad, India' }; $scope.Employee = { username: 'Mannu', address: 'Bangaluru, USA' }; }); app.directive("myDetails", function () { return { scope: { People: '=info' }, templateUrl: '/DemoSupportingFiles/angularjs-scope-isolate-details.html' }; }); </script> <div ng-app="app" ng-controller="CustomDirectiveIsolateScope"> <my-details info="Member"></my-details> <my-details info="Employee"></my-details> </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output