Build a model dialogSRsachin rastogi9yAsked Dec 15, 2017, 2:13 AM EST3 answersShareLinkedInXCopy linkSaveHi AllI am using Angular 4.0. And I and to build a model dialog on button click event. can you please share simple code in Angular
Build a model dialogSRsachin rastogi9yAsked Dec 15, 2017, 2:13 AM EST3 answersShareLinkedInXCopy linkSaveHi AllI am using Angular 4.0. And I and to build a model dialog on button click event. can you please share simple code in Angular
Ankit SharmaRank #141 · 16.1K reputation9y agoPosted Dec 15, 2017, 5:27 AM EST0Hi Sachin, Please visit belwo links https://stackoverflow.com/questions/43533463/how-to-create-a-modal-popup-that-is-compatible-with-angular-4 https://material.angular.io/components/dialog/overview 0
Akshay PhadkeRank #161 · 14.6K reputation9y agoPosted Dec 15, 2017, 8:10 AM EST0simple and straight forward code Open Modal×Modal HeaderSome text in the modal.Close0Laxmidhar SahooRank #383 · 6.6K reputation9y agoPosted Dec 16, 2017, 12:56 AM EST0sir go through some stapes 1 - create a html file named Popup.html like bellow code > <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>title> head> <body> Thanks you body> html> pest the bellow code in the view page @{ Layout = null; } > <html data-ng-app="test"> <head> @* <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"> <link href="https://gitcdn.github.io/bootstrap-toggle/2.1.0/css/bootstrap-toggle.min.css" rel="stylesheet"> <script src="https://code.jquery.com/jquery-2.1.3.min.js">script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js">script> <script src="https://code.angularjs.org/1.4.7/angular.js">script> <script src="https://gitcdn.github.io/bootstrap-toggle/2.1.0/js/bootstrap-toggle.min.js">script>*@ <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js">script> <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.4.js">script> <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"> <script> angular.module('PopupDemo', ['ui.bootstrap']); angular.module('PopupDemo') .controller('PopupDemoController', ['$scope', '$modal', function ($scope, $modal) { $scope.open = function () { var modalInstance = $modal.open({ templateUrl: 'Popup.html' }); alert("OK"); } } ] ); script> head> <body ng-app="PopupDemo"> <div ng-controller="PopupDemoController"> <a ng-click="open()" >Open Popupa> div> body> html> 0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Laxmidhar SahooRank #383 · 6.6K reputation9y agoPosted Dec 16, 2017, 12:56 AM EST0sir go through some stapes 1 - create a html file named Popup.html like bellow code > <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>title> head> <body> Thanks you body> html> pest the bellow code in the view page @{ Layout = null; } > <html data-ng-app="test"> <head> @* <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"> <link href="https://gitcdn.github.io/bootstrap-toggle/2.1.0/css/bootstrap-toggle.min.css" rel="stylesheet"> <script src="https://code.jquery.com/jquery-2.1.3.min.js">script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js">script> <script src="https://code.angularjs.org/1.4.7/angular.js">script> <script src="https://gitcdn.github.io/bootstrap-toggle/2.1.0/js/bootstrap-toggle.min.js">script>*@ <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js">script> <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.4.js">script> <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"> <script> angular.module('PopupDemo', ['ui.bootstrap']); angular.module('PopupDemo') .controller('PopupDemoController', ['$scope', '$modal', function ($scope, $modal) { $scope.open = function () { var modalInstance = $modal.open({ templateUrl: 'Popup.html' }); alert("OK"); } } ] ); script> head> <body ng-app="PopupDemo"> <div ng-controller="PopupDemoController"> <a ng-click="open()" >Open Popupa> div> body> html> 0
Ankit SharmaRank #141 · 16.1K reputationPosted Dec 15, 2017, 5:27 AM EST
Akshay PhadkeRank #161 · 14.6K reputationPosted Dec 15, 2017, 8:10 AM EST
Modal Header
Some text in the modal.
Laxmidhar SahooRank #383 · 6.6K reputationPosted Dec 16, 2017, 12:56 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts