Prev Demo
AngularJS
>
Custom Directive With Templateurl
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", []) .controller("CustomDirectiveController", function ($scope) { $scope.username = "SheoNarayan"; $scope.address = "Hyderabad, India"; }); app.directive('myCustomUrl', function () { return { templateUrl: '/DemoSupportingFiles/angularjs-details.html' }; }); </script> <div ng-app="app" ng-controller="CustomDirectiveController"> <h2>Custom directive with external page</h2> <div my-custom-url></div> </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output