Toggle navigation
Html
Html
Html5
Css
Bootstrap3
Javascript
JavaScript
AngularJS
TypeScript
Languages
C
PHP
C#
.Net
Database
PL/SQL
MySQL
Oracle
Q & A
Articles
Tools
Examples
Online Editor
GO
Angularjs Tutorials
AJS Home
AJS Introduction
AJS Setup
AJS Awesome Features
AJS Life Cycle
AJS MVC Architecture
AJS Bootstrap Process
AJS IntelliSense for VS 2013
AJS Input Types
AJS Modules
AJS Expression
AJS Scopes
AJS Controller
AJS Controller Function
AJS Controller Inheritance
AJS Directives
AJS Built-in Directives
AJS Custom Directives
AJS Built-in Functions
AJS Templates
AJS Built-in Filters
AJS Custom Filter
AJS Built-in Events
AJS Scope Methods
AJS Services
AJS Built-in Services
AJS Routing
AJS Provider
AJS Factory
AJS Messages
AJS HTML DOM
AJS Forms
AJS Form Validation
Angularjs References
AJS Input Types Reference
AJS Directive Reference
AJS Filter Reference
AJS Function Reference
AJS Scope Reference
AJS Service Reference
AJS Event Reference
Angularjs Examples
AJS Examples
Share with Facebook
Share with Google
Share with LinkedIn
Share with Twitter
« Previous
Next »
AngularJS ToJSON Function
AngularJS toJson function is intended to serializes input into a JSON-formatted string.
Syntax
angular.toJson(obj, pretty);
AngularJS ToJSON Function Example
<!DOCTYPE html> <html ng-app=""> <head> <!-- www.techstrikers.com --> <title>My first AngularJS code</title> <script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"> </script> </head> <body bgcolor="#bnde45"> <fieldset> <legend>AngularJS ToJSON Function</legend> <script> var mySource1 = {'name' : 'Jimi', 'age' : '30',} var mySource3 = {'address' : '12-13/A12', 'phone' : '111-111-1111'} document.write(angular.toJson(mySource1)); document.write("</br>"); document.write(angular.toJson(mySource3)); document.write("</br>"); </script> </fieldset> </body> </html>
See Live Example
« Previous
Next »
AngularJS Code Examples
AngularJS Live Demo
ASP.NET Code Examples
Javascript Code Examples
Interview Q & A
Google MAP API Live Demo
Google MAP API Code Examples
Utility Tools
Articles
Recent Articles
Getting Started With ASP.NET Core MVC Application
Setup and Installation ASP.NET Core 1.0
Understanding ASP.NET Core 1.0
Customize User Profile Info in MVC With ASP.NET Identity
How to extend the properties of Identity with additional custom properties in ASP.NET
ASP.NET Identity Authentication - User Login and Registration Form
Understanding ASP.NET Identity
Implement custom user registration and login page with the help of Entity Framework using AES encryption in ASP.NET MVC application
Export Report as CSV or XLSX or XLS from ReportViewer in ASP.NET
JQGrid Server-Side processing using HttpHandler in ASP.NET