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 GMTValidate Input type radio (RadioButton) control (at least one selected) in AngularJS<p>How to&nbsp;validate atleast one radio button selected in AngularJS</p>https://www.aspforums.net:443/Threads/177018/Validate-Input-type-radio-RadioButton-control-at-least-one-selected-in-AngularJS/https://www.aspforums.net:443/Threads/177018/Validate-Input-type-radio-RadioButton-control-at-least-one-selected-in-AngularJS/Tue, 25 Jun 2019 23:46:15 GMTUsing multiple ng-app with in page in AngularJS<p>how to use Multiple ng-app with in a page in AngularJS.</p> <p>Does i have to declare multiple ng-app in the page or i have to use nested div for this.</p>https://www.aspforums.net:443/Threads/301595/Using-multiple-ng-app-with-in-page-in-AngularJS/https://www.aspforums.net:443/Threads/301595/Using-multiple-ng-app-with-in-page-in-AngularJS/Mon, 08 Jul 2019 23:41:40 GMTUsing jQuery Datatable in AngularJS<p>How to use datatable in angularjs ?</p>https://www.aspforums.net:443/Threads/136242/Using-jQuery-Datatable-in-AngularJS/https://www.aspforums.net:443/Threads/136242/Using-jQuery-Datatable-in-AngularJS/Thu, 30 May 2019 02:08:30 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 Controller As in AngularJS<p>What is the use of Controller as in AngularJS?</p> <p>Why we use&nbsp;Controller as?</p> <p>Please provide an example for this to understand it.</p>https://www.aspforums.net:443/Threads/204380/Using-Controller-As-in-AngularJS/https://www.aspforums.net:443/Threads/204380/Using-Controller-As-in-AngularJS/Mon, 08 Jul 2019 11:12:48 GMTUsing Authorization Service in AngularJS<p>How to use authorizationService in AngularJS? Please explain with example.</p>https://www.aspforums.net:443/Threads/801857/Using-Authorization-Service-in-AngularJS/https://www.aspforums.net:443/Threads/801857/Using-Authorization-Service-in-AngularJS/Fri, 28 Jun 2019 00:05:44 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 GMTUI Routing example in AngularJS<p>What is UI Routing in AngularJS and how to implement it.</p>https://www.aspforums.net:443/Threads/159630/UI-Routing-example-in-AngularJS/https://www.aspforums.net:443/Threads/159630/UI-Routing-example-in-AngularJS/Wed, 19 Jun 2019 23:51:48 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 GMTToken Based Authentication using ASP.Net Web API in AngularJS<p>I have two textboxes; one is username and the other is password with a login button. Whenever the user enters the username and password, it must redirect to the html page using token based authentication in web api. The second(html) page must display the username and corresponding userid by checking the database. The values passed are dynamic, i.e., username, password and userid are already present in the database.</p> <p>&nbsp;</p> <p>Regards</p> <p>skp</p>https://www.aspforums.net:443/Threads/130169/Token-Based-Authentication-using-ASPNet-Web-API-in-AngularJS/https://www.aspforums.net:443/Threads/130169/Token-Based-Authentication-using-ASPNet-Web-API-in-AngularJS/Tue, 09 Apr 2019 05:19:16 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 GMTSubmit data when All TextBox in Table Row has value in AngularJS<p>How to submit data into database only when the textbox has some value in angularjs.</p> <p>Here, only the first row data is taken into the database and when the first row textbox data is empty, the remaining textbox data is not getting inserted.</p> <p>For Eg :&nbsp;</p> <p>If the textbox value is 0, the data should not get into the database and if the textbox value is 1, 100, etc, the data should get into the database&nbsp;</p> <pre class="brush: html"> &lt;div class=&#34;bg-white mb-1&#34;&gt; &lt;div class=&#34;row m-1 p-1&#34; ng-repeat=&#34;item in mydata&#34;&gt; &lt;div class=&#34;col-md-1 pull-left airways-info-sect&#34;&gt; &lt;span class=&#34;fli-code&#34;&gt;Serial No&lt;/span&gt; &lt;span class=&#34;airways-name&#34; style=&#34;text-align:center;&#34;&gt;{{$index + 1}}&lt;/span&gt; &lt;/div&gt; &lt;div class=&#34;col-md-4 pull-left airways-info-sect&#34;&gt; &lt;span class=&#34;fli-code&#34;&gt;Part Name&lt;/span&gt; &lt;span class=&#34;airways-name&#34; style=&#34;text-align: left;&#34;&gt;{{item.PartName}}&lt;/span&gt; &lt;/div&gt; &lt;div class=&#34;col-md-2 pull-left airways-info-sect&#34;&gt; &lt;span class=&#34;fli-code&#34;&gt;No Of Pallets&lt;/span&gt; &lt;span class=&#34;airways-name &#34;&gt; &lt;input type=&#34;number&#34; min=&#34;0&#34; class=&#34;&#34; placeholder=&#34;&#34; ng-model=&#34;item.num&#34; ng-init=&#34;item.num=0&#34; ng-change=&#34;calc($index)&#34; required=&#34;&#34; style=&#34;border:1px solid #333; width:20%; text-align:right&#34; /&gt;&lt;i class=&#34;mr-3 fa fa-plus-square-o&#34; style=&#34;font-size:22px; padding-left:5px; position:absolute;&#34;&gt;&lt;/i&gt; &lt;/span&gt; &lt;/div&gt; &lt;div class=&#34;col-md-1 pull-left airways-info-sect&#34;&gt; &lt;span class=&#34;fli-code&#34;&gt;Pallet Qty&lt;/span&gt; &lt;span class=&#34;airways-name&#34; style=&#34;text-align:right;&#34;&gt;{{item.PalletCapacity}}&lt;/span&gt; &lt;/div&gt; &lt;div class=&#34;col-md-1 pull-left airways-info-sect&#34;&gt; &lt;span class=&#34;fli-code&#34;&gt;Accept Qty&lt;/span&gt; &lt;span class=&#34;airways-name&#34;&gt;{{item.Numbers}}&lt;/span&gt; &lt;/div&gt; &lt;div class=&#34;col-md-1 pull-left airways-info-sect&#34;&gt; &lt;span class=&#34;fli-code&#34;&gt;Issued Qty&lt;/span&gt; &lt;span class=&#34;airways-name&#34; style=&#34;text-align:right;&#34;&gt;{{item.IssuedQty}}&lt;/span&gt; &lt;/div&gt; &lt;div class=&#34;col-md-1 pull-left airways-info-sect&#34;&gt; &lt;span class=&#34;fli-code&#34;&gt;Issue Qty&lt;/span&gt; &lt;input type=&#34;number&#34; class=&#34;&#34; placeholder=&#34;&#34; ng-model=&#34;item.mul&#34; ng-init=&#34;item.mul=0&#34; required=&#34;&#34; style=&#34;border: 1px solid #333; width: 90%; text-align: right&#34; /&gt; &lt;/div&gt; &lt;div class=&#34;col-md-1 pull-left airways-info-sect&#34;&gt; &lt;span class=&#34;fli-code&#34;&gt;Stock&lt;/span&gt; &lt;span class=&#34;airways-name&#34; style=&#34;text-align:right;&#34;&gt;{{item.Stock}}&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &nbsp; &lt;input type=&#34;button&#34; class=&#34;btn btn-primary bg-purple my-2 float-right mt-2 border-0&#34; value=&#34;{{btntext}}&#34; ng-click=&#34;submit()&#34; ng-disabled=&#34;isDisabled&#34; data-toggle=&#34;modal&#34; data-target=&#34;#myModal2&#34;&gt;&nbsp; &nbsp;</pre> <p>&nbsp;</p> <pre class="brush: js"> if ($scope.mydata[0].mul &gt; 0 &amp;&amp; typeof ($scope.plNo) != &#34;undefined&#34;) { $http({ method: &#34;POST&#34;, url: apiUrl + &#34;/api/Warehouse/AddIssueDetails&#34;, data: JSON.stringify(issueDetails), dataType: &#39;json&#39;, contentType: &#39;application/json&#39; }).then(function (data, status) { }); } else { $window.alert(&#34;Please enter some details&#34;); }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/916253/Submit-data-when-All-TextBox-in-Table-Row-has-value-in-AngularJS/https://www.aspforums.net:443/Threads/916253/Submit-data-when-All-TextBox-in-Table-Row-has-value-in-AngularJS/Tue, 16 Jul 2019 04:08:23 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 GMTShow Hide Button in Table based on Role using WebService in AngularJS<p>How to show hide Button in table row based on Role in ASP.Net using&nbsp;AngularJS</p> <h1 class="header"><a title="Show Hide Edit Button in GridView based on Role in ASP.Net using C# and VB.Net'a" href="https://www.aspsnippets.com/Articles/Show-Hide-Edit-Button-in-GridView-based-on-Role-in-ASPNet-using-C-and-VBNet.aspx">Show Hide Edit Button in GridView based on Role in ASP.Net using C# and VB.Net</a></h1>https://www.aspforums.net:443/Threads/160497/Show-Hide-Button-in-Table-based-on-Role-using-WebService-in-AngularJS/https://www.aspforums.net:443/Threads/160497/Show-Hide-Button-in-Table-based-on-Role-using-WebService-in-AngularJS/Wed, 17 Jul 2019 00:14:49 GMTShow (Display) different Tabs based on condition in Angular 7<p>I am very new to Angular and I have recently started working on Angular7 project. I am stuck in below implementation:</p> <p>I have to show different tabs based on selected FieldName. Example: If FieldName == 'Field 1', show tab: Tab1, Tab2 If FieldName == 'Field 2', show tab: Tab2, Tab3, likewise.</p> <p>My code is as below: Component.HTML</p> <pre class="brush: html">&lt;div class=&#34;menu-og&#34;&gt; &lt;ul&gt; &lt;li *ngFor=&#34;let tab of tabArray;let i = index&#34; [class.active]=&#34;selectedIndex === i&#34; (click)=&#34;getCurrentTab(tab,i)&#34; &gt; &lt;a&gt;{{tab.title}}&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;</pre> <p>Component.ts</p> <pre class="brush: js">@Input() public selectedField: string; // here I am getting the selected field from the application public tabArray: ProdPerfTabList[] = [ {title: &#39;TAB 1&#39;}, {title: &#39;TAB 2&#39;}, {title: &#39;TAB 3&#39;}, ]; public selectedIndex: number = 0; public tab: ProdPerfTabs; // constructor() {} public ngOnInit(): void { this.getCurrentTab(this.tabArray[0], 0); } public getCurrentTab(tab: ProdPerfTabList, i: number): void { this.tab = ProdPerfTabs[tab.title]; this.selectedIndex = i; this.selectedTab.emit(this.tab); }</pre> <p>Model.ts</p> <pre class="brush: csharp">export enum ProdPerfTabs { TAB 1 = &#39;TAB 1&#39;, TAB 2 = &#39;TAB 2&#39;, TAB 3 = &#39;TAB 3&#39;, } export interface ProdPerfTabList { title: string; }</pre> <p>I want to do the above implementation using model. Apologize if my question is too basic. Any help would be appreciated. Thank you in advance</p>https://www.aspforums.net:443/Threads/126290/Show-Display-different-Tabs-based-on-condition-in-Angular-7/https://www.aspforums.net:443/Threads/126290/Show-Display-different-Tabs-based-on-condition-in-Angular-7/Tue, 11 Jun 2019 00:02:53 GMT