ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.What is Dependency Injection and how to use Dependency Injection in Controller of AngularJs in ASP.Net<p>hello sir&nbsp;</p> <p>i am new in angular js and want to know about dependency injection</p> <p>any one tell me the esay way what is dependency and why it is so usefull&nbsp;</p> <p>like below example we create scop and http as a injector i think</p> <pre class="brush: js"> countryApp.controller(&#39;CountryCtrl&#39;, [&#39;$scope&#39;, &#39;$http&#39;, function (scope, http){ http.get(&#39;countries.json&#39;).success(function(data) { scope.countries = data; });</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/853957/What-is-Dependency-Injection-and-how-to-use-Dependency-Injection-in-Controller-of-AngularJs-in-ASPNet/https://www.aspforums.net:443/Threads/853957/What-is-Dependency-Injection-and-how-to-use-Dependency-Injection-in-Controller-of-AngularJs-in-ASPNet/Mon, 12 Jun 2017 02:20:33 GMTUsing Ecmascript (es6) in AngularJS 2<p>What is Ecmascript in angular</p>https://www.aspforums.net:443/Threads/653365/Using-Ecmascript-es6-in-AngularJS-2/https://www.aspforums.net:443/Threads/653365/Using-Ecmascript-es6-in-AngularJS-2/Wed, 06 Mar 2019 23:05:34 GMTUsing Angular Material DatePicker control in AngularJS<p>hi all</p> <p>please help, i new to Angular&nbsp;</p> <p>i have added datetime&nbsp;control in html like</p> <div> <div> <pre class="brush: html">&lt;md-form-field&gt; &lt;input mdInput [mdDatepicker]=&#34;picker&#34; placeholder=&#34;Choose a date&#34;&gt; &lt;md-datepicker-toggle mdSuffix [for]=&#34;picker&#34;&gt;&lt;/md-datepicker-toggle&gt; &lt;md-datepicker #picker&gt;&lt;/md-datepicker&gt; &lt;/md-form-field&gt;</pre> <p>but it is not reflecting in the form and how to do the validation for dates Like it Not&nbsp;Accept future Dates&nbsp;</p> </div> <div>please help me</div> <div>&nbsp;</div> <div>thanks and regards</div> <div>&nbsp;</div> <div>siddu</div> </div>https://www.aspforums.net:443/Threads/174619/Using-Angular-Material-DatePicker-control-in-AngularJS/https://www.aspforums.net:443/Threads/174619/Using-Angular-Material-DatePicker-control-in-AngularJS/Thu, 13 Dec 2018 23:30:04 GMTUpload files and form data in same request using AngularJS in ASP.Net<p>Does anybody know how i can upload image and post form data at the same time with AngularJS and web api. Its urgent!!!</p>https://www.aspforums.net:443/Threads/540230/Upload-files-and-form-data-in-same-request-using-AngularJS-in-ASPNet/https://www.aspforums.net:443/Threads/540230/Upload-files-and-form-data-in-same-request-using-AngularJS-in-ASPNet/Mon, 26 Feb 2018 02:44:45 GMTUpdate record using Web API and AngularJS in ASP.Net MVC<p>Hi,</p> <p>I want to update a row in html table using webApi and angular js</p> <p>I have created a table employee and add to the application using entity frame work's Databasefirst method</p> <p>this is code for html </p> <pre class="brush: html">&lt;div ng-app=&#34;myApp&#34;&gt; &lt;div ng-controller=&#34;myCtrl&#34; ng-init=&#34;GetAllData()&#34;&gt; &lt;p&gt;List Of Employees&lt;/p&gt; &lt;table class=&#34;table table-bordered table-hover&#34;&gt; &lt;thead class=&#34;thed-dark&#34;&gt; &lt;tr&gt;&lt;th scope=&#34;col&#34;&gt;ID&lt;/th&gt;&lt;th&gt;FirstName&lt;/th&gt;&lt;th&gt;LastName&lt;/th&gt;&lt;th&gt;Company&lt;/th&gt;&lt;th&gt;Actions&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt; &lt;tr ng-repeat=&#34;Emp in employees&#34;&gt; &lt;td&gt;{{Emp.Id}}&lt;/td&gt; &lt;td&gt;{{Emp.FirstName}}&lt;/td&gt; &lt;td&gt;{{Emp.LastName}}&lt;/td&gt; &lt;td&gt;{{Emp.Company}}&lt;/td&gt; &lt;td&gt; &lt;input type=&#34;button&#34; class=&#34;btn btn-warning&#34; value=&#34;Update&#34; ng-click=&#34;UpdateEmp(Emp)&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table&gt; &lt;tr&gt;&lt;td&gt;&lt;label class=&#34;col-md-4 control-label&#34;&gt;FirstName:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&#34;text&#34; class=&#34;form-control&#34; placeholder=&#34;FirstName&#34; ng-model=&#34;FirstName&#34;&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;label class=&#34;col-md-4 control-label&#34;&gt;LaststName:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&#34;text&#34; class=&#34;form-control&#34; placeholder=&#34;FirstName&#34; ng-model=&#34;LastName&#34;&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;label class=&#34;col-md-4 control-label&#34;&gt;Company:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&#34;text&#34; class=&#34;form-control&#34; id=&#34;inputEmail&#34; placeholder=&#34;Company&#34; ng-model=&#34;Company&#34;&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;input type=&#34;button&#34; id=&#34;btnSave&#34; class=&#34;form-control btn-space&#34; value=&#34;Submit&#34; ng-click=&#34;UpdateData(Emp)&#34; /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt;</pre> <p>code for displays in html table,display row in textboxes and code for updating </p> <pre class="brush: js">&lt;script src=&#34;~/Scripts/angular.min.js&#34;&gt;&lt;/script&gt; &lt;script &gt; var app = angular.module(&#34;myApp&#34;, []); app.controller(&#34;myCtrl&#34;, function ($scope, $http) { //displays in html table $scope.GetAllData = function () { $http.get(&#39;/api/employee&#39;).then(function (response) { $scope.employees = response.data }, function (status) { alert(status); }); } // //Displaying values in textboxes $scope.UpdateEmp = function (Emp) { // $scope.employees[index].FirstName = &#34;rajkumar&#34;; $scope.FirstName = Emp.FirstName; $scope.LastName = Emp.LastName; $scope.Company = Emp.Company; } //updating the data to database $scope.UpdateData = function (Emp) { Emp.FirstName = $scope.FirstName; Emp.LastName = $scope.LastName; Emp.Company = $scope.Company; alert(Emp.FirstName); $http.put(&#39;/api/Employee&#39;,Emp).then(function () { alert(&#34;success&#34;); }) } // }); &lt;/script&gt;</pre> <p>problem is code for updating is not working</p> <p>how to solve this</p> <p>regards</p> <p>Baiju</p>https://www.aspforums.net:443/Threads/460601/Update-record-using-Web-API-and-AngularJS-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/460601/Update-record-using-Web-API-and-AngularJS-in-ASPNet-MVC/Mon, 06 Aug 2018 00:34:36 GMTTwo way databinding in AngularJS<p>Can you please explain with an example what is two way databinding in angularjs.</p>https://www.aspforums.net:443/Threads/999188/Two-way-databinding-in-AngularJS/https://www.aspforums.net:443/Threads/999188/Two-way-databinding-in-AngularJS/Mon, 21 Jan 2019 22:37:36 GMTTutorials for AngularJS 2 / 4 / 5<p>Hi,</p> <p>Is there any tutorials for Angular 2/4/5 for learning Angular step by step.</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/476640/Tutorials-for-AngularJS-2-4-5/https://www.aspforums.net:443/Threads/476640/Tutorials-for-AngularJS-2-4-5/Thu, 14 Dec 2017 05:02:34 GMTtsconfig, package, systemjs json file and app.module.ts file in AngularJS 2<p>Explain tsconfig.json file, package.json file, systemjs.config.json file, app.module.ts file&nbsp;in angularjs 2</p>https://www.aspforums.net:443/Threads/435665/tsconfig-package-systemjs-json-file-and-appmodulets-file-in-AngularJS-2/https://www.aspforums.net:443/Threads/435665/tsconfig-package-systemjs-json-file-and-appmodulets-file-in-AngularJS-2/Tue, 26 Feb 2019 23:14:37 GMTSubstring Example in AngularJS<p>How to use substring in angularjs</p>https://www.aspforums.net:443/Threads/300069/Substring-Example-in-AngularJS/https://www.aspforums.net:443/Threads/300069/Substring-Example-in-AngularJS/Wed, 27 Feb 2019 22:40:12 GMTShow Hide HTML DIV using AngularJS<p>I wonder how&nbsp; it work?</p> <pre class="brush: html">//If DIV is visible it will be hidden and vice versa. $scope.IsVisible = value == &#34;Y&#34;;</pre> <p>DIV is visible it will be hidden and vice versa</p>https://www.aspforums.net:443/Threads/210669/Show-Hide-HTML-DIV-using-AngularJS/https://www.aspforums.net:443/Threads/210669/Show-Hide-HTML-DIV-using-AngularJS/Tue, 20 Feb 2018 01:26:02 GMTSet Selected Value for DropDownList on Button click in AngularJS<p>Hi,</p> <p>we have Name and Category Fields. after clicking of edit functionality in the below code one pop up shoule be appear</p> <p>In that Name and Category Fields are displaying&nbsp;</p> <p>Name value is displaying propely but category value is showing empty</p> <p>I want to display relevant row category name on that pop up</p> <p>Update is working fine.</p> <p>Problem is after clciking of edit func() value is not displaying on Category</p> <p>Please help me&nbsp;</p> <pre class="brush: html">&lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;link rel=&#34;stylesheet&#34; href=&#34;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css&#34;&gt; &lt;link rel=&#34;stylesheet&#34; href=&#34;https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2-rc.1/css/select2.min.css&#34; /&gt; &lt;script src=&#34;https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2-rc.1/js/select2.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2-rc.1/js/select2.full.js&#34;&gt;&lt;/script&gt; &lt;script src=&#34;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js&#34;&gt;&lt;/script&gt; &lt;script src=&#34;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.8/angular.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; var app = angular.module(&#39;MyApp&#39;, []) app.directive(&#34;select2&#34;, function ($timeout, $parse) { return { restrict// Code goes here : &#39;AC&#39;, require: &#39;ngModel&#39;, link: function (scope, element, attrs) { console.log(attrs); $timeout(function () { element.select2(); element.select2Initialized = true; }); var refreshSelect = function () { if (!element.select2Initialized) return; $timeout(function () { element.trigger(&#39;change&#39;); }); }; var recreateSelect = function () { if (!element.select2Initialized) return; $timeout(function () { element.select2(&#39;destroy&#39;); element.select2(); }); }; scope.$watch(attrs.ngModel, refreshSelect); if (attrs.ngOptions) { var list = attrs.ngOptions.match(/ in ([^ ]*)/)[1]; // watch for option list change scope.$watch(list, recreateSelect); } if (attrs.ngDisabled) { scope.$watch(attrs.ngDisabled, refreshSelect); } } }; }); app.controller(&#39;MyController&#39;, function ($scope, $window) { $scope.EditCustomer; $scope.EditIndex; $scope.Customers = []; $scope.Orders = []; $scope.categories = [ { CategoryID: 1, CategortName: &#39;Starbuck&#39; }, { CategoryID: 2, CategortName: &#39;Appolo&#39; }, { CategoryID: 3, CategortName: &#39;Saul Tigh&#39; }, { CategoryID: 4, CategortName: &#39;Adama&#39; }] $scope.Add = function () { //Add the new item to the Array. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;var customer = {}; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;customer.Name = $scope.Name; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;customer.Category = $scope.Category.CategortName; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Customers.push(customer); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;//Clear the TextBoxes. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Name = &#34;&#34;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Category = &#34;&#34;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Date = &#34;&#34;; &nbsp; &nbsp; &nbsp; &nbsp; }; &nbsp; &nbsp; &nbsp; &nbsp; $scope.Remove = function (index) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;//Find the record using Index from Array. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;var name = $scope.Customers[index].Name; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if ($window.confirm(&#34;Do you want to delete: &#34; + name)) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; //Remove the item from Array using Index. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; $scope.Customers.splice(index, 1); &nbsp; &nbsp; &nbsp; &nbsp; } } $scope.edit = function (index) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.EditCustomer = $scope.Customers[index]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Name = $scope.EditCustomer.Name; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Category= $scope.EditCustomer.Category; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.EditIndex = index; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;alert($scope.EditCustomer); &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; $scope.Update = function (index) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;alert(&#34;updated&#34;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;//Find the record using Index from Array. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.EditCustomer.Name = $scope.Name; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.EditCustomer.Category = $scope.Category.CategortName; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Customers[index] = $scope.EditCustomer; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;alert($scope.EditCustomer); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Name = &#34;&#34;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$scope.Category = &#34;&#34;; } &nbsp; &nbsp; &nbsp; &nbsp; $scope.reset = function () { $scope.Name = &#34;&#34;; $scope.Category = &#34;&#34;; &nbsp; &nbsp; &nbsp; &nbsp; } }); &lt;/script&gt; &lt;div ng-app=&#34;MyApp&#34; ng-controller=&#34;MyController&#34;&gt; &lt;table cellpadding=&#34;0&#34; cellspacing=&#34;0&#34;&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Category&lt;/th&gt; &lt;th&gt; &lt;/th&gt; &lt;/tr&gt; &lt;tbody ng-repeat=&#34;m in Customers&#34;&gt; &lt;tr&gt; &lt;td&gt;{{m.Name}}&lt;/td&gt; &lt;td&gt;{{m.Category}}&lt;/td&gt; &lt;td&gt;&lt;input type=&#34;button&#34; ng-click=&#34;edit($index)&#34; class=&#34;btn btn-sm btn-primary&#34; data-toggle=&#34;modal&#34; data-target=&#34;#popup2&#34; value=&#34;edit&#34; /&gt;&lt;/td&gt; &lt;td&gt; &lt;input type=&#34;button&#34; ng-click=&#34;Remove($index)&#34; value=&#34;Remove&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;tfoot&gt; &lt;tr&gt; &lt;td&gt;&lt;input type=&#34;text&#34; ng-model=&#34;Name&#34; /&gt;&lt;/td&gt; &lt;td&gt; &lt;select class=&#34;input-sm form-control&#34; select2=&#34;&#34; name=&#34;CategortName&#34; ng-model=&#34;Category&#34; containerCssClass=&#34;all&#34; ng-change=&#34;GetProducts()&#34; ng-options=&#34;c as c.CategortName for c in categories&#34; ng-disabled=&#34;disabled&#34;&gt; &lt;option value=&#34;&#34;&gt;Select Category&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt;&lt;input type=&#34;button&#34; ng-click=&#34;Add()&#34; value=&#34;Add&#34; /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tfoot&gt; &lt;/table&gt; &lt;div class=&#34;modal fade&#34; id=&#34;popup2&#34; role=&#34;dialog&#34;&gt; &lt;div class=&#34;modal-dialog modal-lg&#34;&gt; &lt;div class=&#34;modal-content&#34;&gt; &lt;div class=&#34;modal-header&#34;&gt; &lt;button type=&#34;button&#34; class=&#34;close&#34; data-dismiss=&#34;modal&#34;&gt;&times;&lt;/button&gt; &lt;h4 class=&#34;modal-title&#34;&gt;Modal Header&lt;/h4&gt; &lt;/div&gt; &lt;div class=&#34;modal-body&#34;&gt; &lt;div class=&#34;s2vk-container&#34;&gt; &lt;div class=&#34;row&#34;&gt; &lt;div class=&#34;col-md-8&#34;&gt; &lt;div class=&#34;panel panel-default&#34; ng-model=&#34;EditCustomer&#34;&gt; &lt;table class=&#34;table table-condensed&#34;&gt; &lt;thead&gt; &lt;tr style=&#34;padding-left:10px; padding-right:10px;&#34; class=&#34;active&#34;&gt; &lt;th class=&#34;thick-line&#34; style=&#34;padding-left:10px; padding-right:20px; padding-top:6px; padding-bottom:6px;&#34;&gt;Name&lt;/th&gt; &lt;th style=&#34;padding-left:10px; padding-right:10px;&#34; class=&#34;thick-line&#34;&gt;Category&lt;/th&gt; &lt;th style=&#34;padding-left:10px; padding-right:10px;&#34; class=&#34;thick-line&#34;&gt;Action&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input type=&#34;text&#34; value=&#34;{{EditCustomer.Name}}&#34; ng-model=&#34;Name&#34; /&gt;&lt;/td&gt; &lt;td&gt; &lt;select class=&#34;input-sm form-control&#34; select2=&#34;&#34; name=&#34;CategortName&#34; ng-model=&#34;Category&#34; value=&#34;{{EditCustomer.Category}}&#34; containerCssClass=&#34;all&#34; ng-options=&#34;c as c.CategortName for c in categories&#34; ng-disabled=&#34;disabled&#34;&gt; &lt;option value=&#34;&#34;&gt;Select Category&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;button type=&#34;button&#34; class=&#34;btn btn-sm btn-primary&#34; ng-click=&#34;Update()&#34;&gt;Update&lt;/button&gt; &lt;button type=&#34;button&#34; class=&#34;btn btn-sm btn-danger&#34; ng-click=&#34;reset()&#34;&gt;cancel&lt;/button&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&#34;modal-footer&#34;&gt; &lt;button type=&#34;button&#34; class=&#34;btn btn-default&#34; data-dismiss=&#34;modal&#34; ng-click=&#34;reset()&#34;&gt;Close&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/456297/Set-Selected-Value-for-DropDownList-on-Button-click-in-AngularJS/https://www.aspforums.net:443/Threads/456297/Set-Selected-Value-for-DropDownList-on-Button-click-in-AngularJS/Mon, 03 Dec 2018 01:47:33 GMTServices example in AngularJS<p>What is service and factory in angularjs.</p>https://www.aspforums.net:443/Threads/130166/Services-example-in-AngularJS/https://www.aspforums.net:443/Threads/130166/Services-example-in-AngularJS/Wed, 23 Jan 2019 22:39:40 GMTsearch record using radiobuttonlist in angularjs<p>Can it is possible to search record using multiple radiobutton in angularjs?</p>https://www.aspforums.net:443/Threads/123593/search-record-using-radiobuttonlist-in-angularjs/https://www.aspforums.net:443/Threads/123593/search-record-using-radiobuttonlist-in-angularjs/Mon, 18 Mar 2019 00:04:19 GMTSearch (Filter) HTML Table created using ng-repeat in AngularJS<p>How to use filter in angularjs to filter table</p>https://www.aspforums.net:443/Threads/843956/Search-Filter-HTML-Table-created-using-ng-repeat-in-AngularJS/https://www.aspforums.net:443/Threads/843956/Search-Filter-HTML-Table-created-using-ng-repeat-in-AngularJS/Mon, 21 Jan 2019 22:37:34 GMTSave image path to Database using AngularJS in ASP.Net<p>====&gt;the webservice</p> <pre class="brush: csharp">[WebMethod] public string insert(string city,string country,string flag) { try { using(SqlConnection conn =new SqlConnection(clsMain.sqlconnstring)) { conn.Open(); SqlCommand cmd = new SqlCommand(&#34;spInsertUploadPicture&#34;, conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue(&#34;@city&#34;, city); cmd.Parameters.AddWithValue(&#34;@country&#34;,country); cmd.Parameters.AddWithValue(&#34;@imgpath&#34;, string.Format(&#34;../imageUploads/{0}&#34;,flag)); cmd.ExecuteNonQuery(); return &#34;Record Uploaded Successfully&#34;; } } catch (Exception) { throw; } }</pre> <p>===&gt;&gt;&gt;&gt; the controller</p> <pre class="brush: js">.directive(&#34;fileInput&#34;,function($parse){ return { restrict: &#34;A&#34;, link: function (scope,elem,attrs) { elem.bind(&#34;change&#34;, function () { $parse(attrs.fileInput).assign(scope, elem[0].files); scope.$apply(); }); } } }) .controller(&#34;imageUploadPracticeController&#34;, function ($scope,$http,$timeout) { var vm = this; vm.loading = false; vm.msg = false; vm.error = false; // read(); vm.imageUpload = function (event) { var files = event.target.files;//filelist object var file = files[files.length - 1]; vm.file = file; var reader = new FileReader(); reader.onload = vm.imageIsLoaded; reader.readAsDataURL(file); } vm.imageIsLoaded = function (e) { $scope.$apply(function () { vm.step = e.target.result; }); } vm.btnUpload = function () { vm.loading = true; var request = $http({ url: &#39;../services/svImageUpload.asmx/insert&#39;, method: &#39;POST&#39;, data: { city: vm.City, country: vm.Country, flag: vm.file.name }, //transformRequest:angular.identity, headers: {&#39;content-type&#39;:undefined} }); request.then(function (response) { read(); vm.loading = false; vm.error = false; vm.hurray = response.data; vm.msg = true; }, function (error) { vm.error = true; vm.error = error.data; vm.loading = false; vm.msg = false; }); //console.log(vm.City + &#39; &#39; + vm.Country + &#39; &#39; + vm.file.name); } var read = function () { var request = $http(&#34;../services/svImageUpload.asmx/GetAllFiles&#34;) .then(function (response) { vm.imgUploads = response.data; }); } vm.closeSuccessMsg = function () { vm.loading = false; vm.msg = false; vm.error = false; $(&#34;#txtCity&#34;).val(&#39;&#39;); $(&#34;#txtCountry&#34;).val(&#39;&#39;); } vm.closeErrorMsg = function () { vm.loading = false; vm.msg = false; vm.error = false; $(&#34;#txtCity&#34;).val(&#39;&#39;); $(&#34;#txtCountry&#34;).val(&#39;&#39;); } });</pre>https://www.aspforums.net:443/Threads/401358/Save-image-path-to-Database-using-AngularJS-in-ASPNet/https://www.aspforums.net:443/Threads/401358/Save-image-path-to-Database-using-AngularJS-in-ASPNet/Fri, 26 May 2017 11:39:14 GMTRouting in AngularJS 2<p>How Routing Works In Angular 2.</p>https://www.aspforums.net:443/Threads/102942/Routing-in-AngularJS-2/https://www.aspforums.net:443/Threads/102942/Routing-in-AngularJS-2/Thu, 07 Mar 2019 22:46:00 GMTRetrieve and display data from Database in TextBox on Button click using AngularJS in ASP.Net<p>how to retrieve data from database to textbox in asp.net angularjs</p> <p>on button click event.</p>https://www.aspforums.net:443/Threads/720928/Retrieve-and-display-data-from-Database-in-TextBox-on-Button-click-using-AngularJS-in-ASPNet/https://www.aspforums.net:443/Threads/720928/Retrieve-and-display-data-from-Database-in-TextBox-on-Button-click-using-AngularJS-in-ASPNet/Sat, 03 Feb 2018 03:54:59 GMTRead JSON object from Url in AngularJS 2<p>Hi sir,</p> <p>i am refering&nbsp; this link&nbsp;</p> <p>https://www.youtube.com/watch?v=oLtwPzr_8uA</p> <p>to read the array of json object,</p> <p>like&nbsp; that i&nbsp; created&nbsp; method ..</p> <pre>export class EmployeeService {<br /> private _url: string = 'http://localhost:8080/Employee/getEmployeeList';<br /><br /> constructor(private _http: Http) {<br /> }<br /><br /> public getallemployee() {<br /> return this._http.get(this._url)<br /> .map((response: Response ) =&gt; response.json());<br /> }<br />}</pre> <p>but i am not able to read the json data, so what can i place in the _url,</p> <p>my method getEmployeeList return array of json object,</p> <p>thanks and regards</p> <p>siddu</p>https://www.aspforums.net:443/Threads/168751/Read-JSON-object-from-Url-in-AngularJS-2/https://www.aspforums.net:443/Threads/168751/Read-JSON-object-from-Url-in-AngularJS-2/Thu, 27 Dec 2018 01:53:36 GMTRead JSON file in AngularJS 2 Error: Cannot read property getDOM of undefined<p>Hi all</p> <p>I am doing the example for read json from the file in angular2</p> <p>here is My code.</p> <pre class="brush: js">export class JsonComponent { people: Object[]; constructor(http: Http) { http.get(&#39;people.json&#39;).subscribe(res =&gt; { this.people = res.json(); }); } active: boolean = false; toggleActiveState() { this.active = !this.active; } }</pre> <p>I am geting error in console As Cannot read property 'getDOM' of undefined</p> <p>please help me</p> <p>thanks and regards</p> <p>siddu</p>https://www.aspforums.net:443/Threads/440989/Read-JSON-file-in-AngularJS-2-Error-Cannot-read-property-getDOM-of-undefined/https://www.aspforums.net:443/Threads/440989/Read-JSON-file-in-AngularJS-2-Error-Cannot-read-property-getDOM-of-undefined/Thu, 27 Dec 2018 21:56:00 GMTPopulate HTML Table with DropDownList (HTML Select) using AngularJS<p>i have table which contains&nbsp; 5 fruits information</p> <p>in each row fruits name and a drop down is there</p> <p>values for drop down are "Select","Yes","No" </p> <p>now i have to display all the 5 fruits information below the table .</p> <p>need to display in table form with the selected dropdown values.</p> <p>Please give me idea in angularJS</p>https://www.aspforums.net:443/Threads/738471/Populate-HTML-Table-with-DropDownList-HTML-Select-using-AngularJS/https://www.aspforums.net:443/Threads/738471/Populate-HTML-Table-with-DropDownList-HTML-Select-using-AngularJS/Fri, 19 Jan 2018 05:17:17 GMT