AngularJS

393

Solutions

270

Contributors

AngularJS is an open-source web application framework used to develop single-page applications. It aims to simplify both the development and the testing of such applications by providing a framework for client-side model–view–controller (MVC) and model–view–viewmodel (MVVM) architectures, along with components commonly used in rich Internet applications. AngularJS is the frontend part of the MEAN stack, together with Node.js runtime, Express.js backend framework and MongoDB database.

Share tech news, updates, or what's on your mind.

Sign up to Post

This is my main.html codeThis is my main.html codeThis is my insert.php codeAnd this is the error which always arises whenver i use localhostHi There I have been getting this issue lately. I don't know where this error come from. Whenever I use my localhost(Obviously i need it for my php files to run) this error arises in console

Error in response to storage.get: SyntaxError: Unexpected token <
    at Object.callback (chrome-extension://nkeimhogjdpnpccoofpliimaahmaaome/js/content.js:1:50)
    at chrome-extension://nkeimhogjdpnpccoofpliimaahmaaome/js/content.js:1:22

This error occurs for all files which i open using localhost.But when I used without localhost ie simply open the html file it works just fine.
Currently I'm learning Angular.js
Here I want to insert data in database using ANGULAR & PHP
0
Get real performance insights from real users
LVL 1
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

I'm going through a basic Angular tutorial and there's a portion of it that I can't get to work and I don't know why.

Head out to http://brucegust.com/adm/angular/ and check it out. It's the very last "application."

Here's the code:

<div data-ng-app="" data-ng-init="firstName='John'">

<p>The name is <span data-ng-bind="firstName"></span></p>

</div>

Open in new window


It should say, "The name is John" and it doesn't.

I'm looking at Google Chrome and there's nothing in the Console that would give me an indicator as to where I'm blowing it.

Any ideas?

Thanks!
0
Hi,
I have used AngularJS sound manager(<sound-manager></sound-manager>).
While playing If i click on the progress bar then it is playing from the beginning, how do i start from the selected position.
This is my HTML code:
<sound-manager></sound-manager> <div class="mv-vmPlayer"> <ul> <li><button id="playPreviousTrack" ng-attr-title="{{localize.ux.messageViewer.PlayPrev_btn_label}}" ng-click="widget.onPlayPrevVMClick()" ng-disabled="widget.playPrevDisable"><i class='icon-arrow-left'></i></button></li> <li><button id="playNextTrack" ng-attr-title="{{localize.ux.messageViewer.PlayNext_btn_label}}" ng-click="widget.onPlayNextVMClick()" ng-disabled="widget.playNextDisable"><i class='icon-arrow-right'></i></button></li> <li><button ng-click="widget.pauseTrack()" ng-attr-title="{{localize.ux.messageViewer.Pause_btn_label}}" ng-disabled="!widget.isPlaying"><i class='icon-pause'></i></button></li> <li><button id="playTrack" ng-attr-title="{{localize.ux.messageViewer.Play_btn_label}}" ng-click="widget.onPlayVMClick()" ng-disabled="widget.playDisable"><i class='icon-play'></i></button></li> <span id="spnEmbedTag"></span> <!--<li><button id="widget.playVM" ng-click="widget.onPlayVMClick()" ng-disabled="widget.playDisable"><i class='icon-play'></i></button>--> <li><label>&nbsp;</label></li> <li><label>&nbsp;</label></li> <li><label>&nbsp;</label></li> <li><label>{{ widget.currentPosition }}</label></li> <li> <div class="seekBase" seek-track> <div id= "seekLoad" class="seekLoad 

Open in new window

0
I had this question after viewing Angular - difference between these 2 pagination methods.

I'm following this example (please scroll down pipe/ajax plugin section here http://lorenzofox3.github.io/smart-table-website/)

In the related question above, I want to do this
"From the page number you can calculate from which index your query will start returning data up to your page limit."

I think I have 2 issues. One is how to get the next index and second...I think I call the database every time user clicks on the next page.

I'll go step by step

1. I changed the stored proc to have row_number. Suppose this. I call it with 1 and 50 and get 50 rows.
create procedure usp_test
@start int,
@end int
as
begin
Select * From( Select *,ROW_NUMBER() OVER(ORDER BY Table.Col) row FROM TableName ) R WHERE row BETWEEN @srart AND @end

end

Open in new window


2. Razor has this (just like the Smart table example)

<table class="table" st-pipe="callServer" st-table="mc.displayedCollectionTest">

Open in new window


3. controller.js has this like the example

 $scopr.callServer = function callServer(tableState) {

    ctrl.isLoading = true;

    var pagination = tableState.pagination;

    var start = pagination.start || 0;     // This is NOT the page number, but the index of item in the list that you want to use to display the table.
    var number = pagination.number || 10;  // Number of entries showed per page.

    cContactService.getPage(start, number, tableState).then(function (result) {
      $scope.displayedCollectionTest = result.data;
      tableState.pagination.numberOfPages = result.numberOfPages;//set the number of pages so the pagination can update
      
    });
  };

Open in new window


4. Issue 1: Here, I don't think this is correct. Database keeps getting called but should it? the example has randomsItems as their datasource but not called on each "page" click to go to next page

In ContactService.js


Open in new window

1
I'm using Smart Table. http://lorenzofox3.github.io/smart-table-website/

Please scroll down to "Client side Pagination" and "pipe/ajax plugin"

In both methods, the database call to get the dataset has to be done upfront...is that correct? What does "pipe/ajax plugin" offer as far as performance that "client side pagination" doesn't offer? I think if both have to get the dataset upfront, there shouldn't be a difference as far as performance but not sure.
0
I am very new to the technologies and learning angular js by developing a quiz app using angular js(MEAN stack). I want to mix the questions of Multiple choice questions and fill in the blank questions. I have created multiple choice questions but I am not able to create fill in the blank questions. could someone please give some suggestions, how to create fill in the blank questions.

for example: how ---you?, what --- you doing?. these kinds of questions.

Thanks in advance
0
I am very new to the technologies and learning angular js by developing a quiz app using angular js(MEAN stack). I want to mix the questions of Multiple choice questions and fill in the blank questions. I have created multiple choice questions but I am not able to create fill in the blank questions. could someone please give some suggestions, how to create fill in the blank questions.

for example: how ---you?, what --- you doing?. these kinds of questions.

Thanks in advance.
0
Hello to All,
Scanario:- I have to share product with user and i have two list- 1st connected user list for share product with user and 2nd is the shared user list(sahred product list) if i have click on  the  checkAll checkbox here all checkbox will be check but at time i have to remove 1 user at  a time and click on the shared user list.now again i click on the checkAll checkbox here only 1 user found and i will get 1 update user but here i will be found all user again because i have iterate all the list again,
angular.forEach($scope.selectedSharedBuyerObjectList) - here i will remove the match keyID and updated the 1 user how  to resolve this issue?


/**
 * @Summary: checkAllConnectedUser function, to create album
 * @param: index, productObj
 * @return: callback(response)
 * @Description:
 */
$scope.shardBuyerKeyIdArray = [];
$scope.countBuyer = 0;
$scope.checkAllSharedBuyer = function(isChecked) {
  if (isChecked) {
    if ($scope.selectAll) {
      $scope.selectAll = false;
    } else {
      $scope.selectAll = true;
    }
    angular.forEach($scope.selectedSharedBuyerObjectList, function(selectedBuyer) {
      selectedBuyer.select = $scope.selectAll;
      //IF ID WILL BE EXIST IN THE ARRAY NOT PSUH THE KEYID
      if ($scope.shardBuyerKeyIdArray.indexOf(selectedBuyer.userTypeDto.keyId) == -1) {
        $scope.shardBuyerKeyIdArray.push(selectedBuyer.userTypeDto.keyId);
        $scope.countBuyer++;
      }
    });
  } else {
    …
0
I have a smart table (followed this example)  http://www.marcorpsa.com/ee/t2444.html

and added paging using this example https://www.js-tutorials.com/javascript-tutorial/angularjs-smart-table-example-demos/

Now, I have 20,000 rows and my paging is 150 pages. But, I bring back the entire 20,000 rows upfont...when the page loads, then page.  Page is very slow. I'm wondering if I shouldn't bring back the 20,000 rows all at once.

I'm using a stored proc and the stored proc itself takes about a couple of seconds. It's when I bind the data to the smart table that takes a few mins.
0
The following is the data I intend to to render to in my angularjs U.I.:

[{"id":1,"name":"T-Shirt","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","category":[{"id":1,"name":"Men","item_id_fk":1,"parent_id":null,"createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","child":[{"id":3,"name":"Long Sleeve","item_id_fk":1,"parent_id":1,"createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27"},{"id":4,"name":"Short Sleeve","item_id_fk":1,"parent_id":1,"createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27"}]},{"id":2,"name":"Women","item_id_fk":1,"parent_id":null,"createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","child":[{"id":5,"name":"Long Sleeve","item_id_fk":1,"parent_id":2,"createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27"},{"id":6,"name":"Short Sleeve","item_id_fk":1,"parent_id":2,"createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27"}]}]},{"id":2,"name":"Jeans","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","category":[]}]

Open in new window


I intend to expand or collapse the category and also the child but so far I have managed to displayed the item without the category and child in the following manner:

<div class="col-xs-12">

	<div class="row">
		<div class="col-md-12 margin-tb">
			<div class="pull-left">
				<h1>Listing Category</h1>
			</div>
			<div class="pull-right">
				<input type="button" 

Open in new window

0
Enroll in August's Course of the Month
LVL 9
Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

I have included pdf through embed tag which will display in a modal after clciking the button using  angualrjs, now i want to show a loading spinner till that pdf loads, how can i get to know that pdf is loaded or not and how can i add spinner? Can anyone help me on this??
0
I have the following angular code:

var myApp = angular.module('myApp', []);

myApp.controller('myAppController', ['$scope', function ($scope) {

    $scope.displayData = [{
        column1: 'row1 column1',
        column2: 'row1 column2',
        column3: 'row1 column3',
        column4: 'row1 column4'
    },
    {
        column1: 'row2 column1',
        column2: 'row2 column2',
        column3: 'row2 column3',
        column4: 'row2 column4'
    },
    {
        column1: 'row3 column1',
        column2: 'row3 column2',
        column3: 'row3 column3',
        column4: 'row3 column4'
    },
    {
        column1: 'row4 column1',
        column2: 'row4 column2',
        column3: 'row4 column3',
        column4: 'row4 column4'
    }

    ];

}]);

Open in new window


With the following html view:
<div ng-app="myApp">
    <div ng-controller="myAppController">
        <div class="row" style="background-color: gray; color: white;">
            <div class="row" style="background-color: gray; color: white;">
                <div class="col-xs-4 col-md-4">Header 1</div>
                <div class="col-xs-2 col-md-2">Header 2</div>
                <div class="col-xs-1 col-md-1">Header 3</div>
                <div class="col-xs-3 col-md-3">Header 4</div>
                <div class="col-xs-1 col-md-1"></div>
                <div class="col-xs-1 col-md-1"></div>
            </div>
        </div>
        <div ng-repeat="dataItem in displayData">
            <div class="row">
                <div class="col-xs-4 col-md-4">{{ dataItem.column1 }}</div>
                <div class="col-xs-2 col-md-2">{{ dataItem.column2 }}</div>
                <div class="col-xs-1 col-md-1">{{ dataItem.column3 }}</div>
                <div class="col-xs-3 col-md-3">{{ dataItem.column4 }}</div>
                <div class="col-xs-1 col-md-1">update</div>
                <div class="col-xs-1 col-md-1">delete</div>
            </div>
        </div>
    </div>
</div>

Open in new window


Which produces the following result:
RegularView.png
But when I make the browser smaller or change the device view, the column header and data seem to overlap:
Problem1.png
Is there an elegant way to resolve this issue?


Thanks.
0
I have the following AngularJs code:
var myApp = angular.module('myApp', []);

myApp.controller('mainController', ['$scope', '$http', function ($scope, $http) {
    
    
    $http.post('/Home/GetDesiredResult', { numberOfRecords: 20 })
        .then(function (response) {
            // success
            console.log(response);
            $scope.desiredResult = response.data;    

             // Over here, $scope.desiredResult contains data       
        }, 
            // Error
            function (response) {
                console.log(response);
        });

    // Over here, $scope.desiredResult is undefined


}]);

Open in new window


What is the cleanest way to get the data I get back from my $http.post saved in $scope.desiredResult so it is accessible in my app?
0
In each bootstrap collapse expand panel I have a table with two columns and multiple rows created. Each row has a checkbox.

Now when I press Update Permission button, I intend to send two values to my angularjs controller namely perm.id and value.id for each row to process.

<div class="col-xs-12">

	<div class="row">
		<div class="col-md-12 margin-tb">
			<div class="pull-left">
				<h1>Listing Module</h1>
			</div>
			<div class="pull-right">
				<input type="button" ng-click="updPermission()" value="Update Permission">  
			</div>
		</div>
	</div>
		
	<div ng-repeat="value in module">
         <div class="panel-group">
              <div class="panel panel-default">
                  <div class="panel-heading">
                    <h4 class="panel-title">
						 <a class="accordion-toggle" data-toggle="collapse" data-target="#collapseModule{{value.id}}">
                            <i class="glyphicon glyphicon-collapse-down"></i>{{value.name}}
						 </a>
                    </h4>
                  </div>
                  <div id="collapseModule{{value.id}}" class="panel-collapse in">
					<div class="panel-body">
						
						<table class="moduleGrid table-striped table-bordered table-hover table-condensed">
						   <thead>
							  <tr>
								 <th>Permission</th>
								 <th>Status</th>
							  </tr>
						   </thead>
						   <tbody>
							  <!-- Now just ng-repeat the rows -->
							  <tr ng-repeat="perm in value.permission">
								 <td>
								

Open in new window

0
The following data is returned from my laravel coded controller:

data object
[{"id":1,"name":"View","createdDate":"2017-07-12 14:54:05","lastUpdate":"2017-11-07 13:52:27"},{"id":2,"name":"Read","createdDate":"2017-07-12 14:54:05","lastUpdate":"2017-11-07 13:52:27"},{"id":3,"name":"Write","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27"},{"id":4,"name":"Update","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27"}]

Open in new window


try object
[{"id":1,"name":"Dashboard","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","permission":[{"id":1,"name":"View","createdDate":"2017-07-12 14:54:05","lastUpdate":"2017-11-07 13:52:27","pivot":{"module_id_fk":1,"permission_id_fk":1}},{"id":3,"name":"Write","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","pivot":{"module_id_fk":1,"permission_id_fk":3}}]},{"id":2,"name":"Employee","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","permission":[{"id":3,"name":"Write","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","pivot":{"module_id_fk":2,"permission_id_fk":3}}]},{"id":3,"name":"Report","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","permission":[]},{"id":4,"name":"Access Right","createdDate":"2017-11-07 13:52:27","lastUpdate":"2017-11-07 13:52:27","permission":[]}]

Open in new window



In my angularjs controller I have the following line of code:

	$scope.compare = function(a,b){
		$scope.tmp = [];	
		for(var outer in a[0]){
			if(b.length>0){
				for(var inner in b){
					if(b[inner].name === a[0][outer].name){
						$scope.tmp.push({"name":a[0][outer].name,"status":true});
					}
				}
			}else{
				$scope.tmp.push({"name":a[0][outer].name,"status":false});
			}
		}
		return $scope.tmp;
	};

	$scope.init = function(){
		
		$scope.dfperm = [];
		$scope.modperm = [];
		$scope.counter = 0;
		
		$http({
			method: 'GET',
			url: "/api/v1/module/list"
		}).then(function successCallback(response){
			//console.log(response.data);
			//$scope.module = response.data;
			$array = response.data;				
						
			angular.forEach($array, function(outer, key) {			
				if(key==='data'){					
					$scope.dfperm.push(outer);
					//$scope.counter++;
				}
				if(key==='try'){
					angular.forEach(outer, function(outerItem, key){ 
						 var tmp = $scope.compare($scope.dfperm,outerItem.permission);
						 $scope.modperm.push({"name":outerItem.name,"permission":tmp});
					});
				}
			});
		}, function errorCallback(response) {
			console.log('intention error',response.data);
		});
		
	}

Open in new window


What I am attempting to do is to create a new permission object that has the status true or false.

As shown the data object contains a list of default permission.

The try object on the other hand shows that each module has permission. A module can have 0 or more than 1 permission.  

Now i'm trying to reconstruct the information so that each module has equal number of default permission but based on the try object conditioning (permission) is done to set the status either true or false.

However my code above doesn't do so. Rather a module with is set based on the try object conditioning (permission) and others are set with the default permission and status false.

Your help is kindly appreciated.
0
I intend to access the outer variable stated below

if(key==='data'){
	outer;  //outer variable
}

Open in new window


Inside the following like of code

angular.forEach(outer.permission, function(outer_perm, key) {	
        //I want to access outer
 });

Open in new window


here is the full line of code:

			angular.forEach($array, function(outer, key) {			
				if(key==='data'){
				    outer;
				}
				if(key==='try'){
					angular.forEach(outer, function(outer, key){
						 $module_name = outer.name; 
						 //console.log($module_name);
						 angular.forEach(outer.permission, function(outer_perm, key) {	
								//I want to access outer
						 });
					});
				}
			});

Open in new window


Your help is kindly appreciated.

Thank You.
0
I have a smart table with 2 columns. I want to have a mouseover with a popup for the second column to display more information. I found this link I'm following this example  http://plnkr.co/edit/3KiZdZsxwy6GDLoy6DhV?p=preview

I've spent at least 4 hours on this and still can't find a solution. I think it might be my injection of ui-bootstrap per this link
Possible explanation

You can see what I'm doing here:

1.  http://147.75.0.124:88   Log in with admin@admin.test and Password321$

2. Click on "Immigration" and click on the link under it

3. Look at Chrome's console and you see the error.

The error and what I've done

1. I get this error Unknown provider: $uibModalProvider <- $uibModal <- chapterCntrl

2. I made sure I have bootstrap.js and bootstrap-tpls.js
3. In module.js, I have this and I have a reference to it in the page  
angular.module('lawApp',   ['ui.bootstrap']);

Open in new window

4. I checked the bootstrap version.
5. In "chapterCntrl", I tried $uibModalInstance, $uibInstance and $uibModal.  I think $uibModal is correct but I still get the error
6. I changed "chapterCntrl" to below but I get an error with mainCntrl not being defined if  do below

(function () {
    'use strict';
    angular.module('lawApp','ui.bootstrap')

        .controller('chapterCntrl', chapterController);

Open in new window


What am I missing? I still think it's how I inject ui.bootstrap but don't know what else to try.
0
I have an angular UI application of two pages where one page takes user input details and insert the values on click of button into MySql DB through an API call and redirects to second page where details entered in first page must be displayed to user.

After inserting the values in first page, the values are stored in DB where it is recorded in php logs but in second page when I want to show the details of user entered, data row doesn't exist in DB.

The insert query is a single row insert and is not under any transaction. However even after implementing transactions same issue persist.

I have records of mysql logs also where there is only the insert log but no delete logs for the same inserted values.

I have kept a count of data before inserting and after inserting, the count got reduced by one when I have made a second API call to get details to second page to display the user details and throwing an exception of 400 bad request.
0
Hello I am using Angular UI Grid to display the data in neat and clean manner. In the UI grid, there is one column as "Duration". I want to sort this column in descending order but unfortunately, i am unable to do that. I tried but it is sorting in text format.
In the controller part I have written as follows:
$scope.sortTrendingEvents = function () {
$scope.slaGridOptions.data = $filter('orderBy')($scope.slaGridOptions.data, "duration", true)
console.log('this button is clicked when trending event is pressed');
};
In the HTML part I have written as:
<button id="toggleFiltering" class="nxn-btn-primary nxn-mar-right-10" ng-click="sortTrendingEvents()">Trending Events</button>

Trending Events
In short what I have done is on the click of a button the Duration column must be sorted in DESC order but with the help of this code,

I am unable to sort this column in number pattern.
Please do guide me. Thank you so much.
0
Free Tool: Port Scanner
LVL 9
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Is there a way to use AngularJS with Bootstrap 4? I would like to use AngularJS' cards and colors in Bootstrap 4. I don't know if this is possible since I'm not really looking into building an apps.
0
1. I followed examples in the link below and coded a map. It works. You can see a map here:

 http://leafletjs.com/examples/choropleth/

You see if you zoom out, you'll see Hawaii and Alaska.

2. I've been asked to make it look like this...Have Alaska and Hawaii next to the US
https://www.highcharts.com/maps/demo/us-counties

3. The Leaflet link in step 1 has the "us counties.js" file

4. I looked at Highchart's JS file (you can see the link in JSFiddle that comes with Highcharts, step 2 above).
    Looks like they have Alaska and Hawaii bundled in a separate section of the JS file and then they have the rest of the states.

Anyone has worked with Leaflet.Js and got Hawaii and Alaska moved next to the US?
0
I have created a new angular project via angular-cli.

I now what to install jQuery but installing it via npm.

How can I do this?
0
createNewASLForm is the main FORM
AslAccount - is the formArray
From Mark up -
<div *ngIf="createNewASLForm.get('AslAccount').get('acctNumber').touched " class="alert alert-danger">
                    Please enter Acct Number
                  </div>

Tried another

<input class="form-control g-remove-margin-bottom" value="" type="text" formControlName="aslFormName" placeholder="ASL Form Name" name ="acctNumber" required>
<div *ngIf="createNewASLForm.controls.AslAccount.controls.['acctNumber'].hasError('required') && createNewASLForm.controls.AslAccount.controls.['acctNumber'].touched" class="alert alert-danger">
Please enter Acct Num
</div>

Also need to add an entry for 11 numerical vals only....
           



Same this works for standalone controls in the main form
 <input class="form-control g-remove-margin-bottom" value="" type="text" formControlName="aslFormName" placeholder="ASL Form Name" name ="aslFormName" required>
              <div *ngIf="createNewASLForm.controls['aslFormName'].hasError('required') && createNewASLForm.controls['aslFormName'].touched" class="alert alert-danger">Please enter ASL form name</div>



Any help or pointers is appreciated.


Tried this one too...
Used this one too in the markup
<input class="form-control g-remove-margin-bottom" value="" type="text" formControlName="myAcct"   required>
<div *ngIf="myForm.get('SomeAcct').get('myAcct').touched " class="alert alert-danger">Please enter Acct Number</div>…
0
I am following the tutorial from here: "http://itsolutionstuff.com/post/codeigniter-3-and-angularjs-crud-with-search-and-pagination-exampleexample.html"

I am getting these errors: errors
Where am i going wrong ? i have tried exhaustively to search for answer or hint but i am lost, i am obviously pretty new to codeigniter.
Here is link to github files that i downloaded for tutorial. I appreciate any help or suggestion. Thank You all.
0
Is this the right way of doing...this is about Angular2 - http observables...
first use a .post and then do .get response of the same form data that was posted....

using a data API here - such as a converted http url to a privately named dataAPI

addFormData(formInput: FormInputs): Observable<FormInputs> {
  let headers = new Headers();
  headers.append('Content-Type', 'application/json');

  let sub = this.http.post(this.dataAPI, JSON.stringify(formInput), {headers: headers}).map(response => response.json()) ;

  sub.subscribe( (aData) => {console.log(aData); }, (err)=> console.log(err),  ()=>{ console.log("Done")} );

  return sub;
0

AngularJS

393

Solutions

270

Contributors

AngularJS is an open-source web application framework used to develop single-page applications. It aims to simplify both the development and the testing of such applications by providing a framework for client-side model–view–controller (MVC) and model–view–viewmodel (MVVM) architectures, along with components commonly used in rich Internet applications. AngularJS is the frontend part of the MEAN stack, together with Node.js runtime, Express.js backend framework and MongoDB database.

Top Experts In
AngularJS