Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Conversation

ltfschoen
Copy link
Contributor

Added suggestion to use JSONLint to validate the JSON file and identify errors. It is simpler to address JSON errors independently of other errors at compile-time.

Motivation was based on personal experience following an applied version of Step 5 of the AngularJS Tutorial using Ionic and incorrectly placing a semi-colon at the end of the JSON file, such that both of the following approaches resulted in errors and data was not displayed in the browser:

$scope.sentences = data; 
$scope.sentences = angular.fromJson(data); 

Solution to the problem (i.e. using JSONLint that identified the incorrectly used semi-colon in the JSON file) was found thanks to a response to my StackOverflow post Here

Added suggestion to use JSONLint to validate the JSON file and identify errors. It is simpler to address JSON errors independently of other errors at compile-time.
@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@ltfschoen
Copy link
Contributor Author

@mary-poppins signed CLA submitted

@caitp
Copy link
Contributor

caitp commented Sep 15, 2014

"We suggest .... [JSONLint.com]" is kind of an endorsement, I'm not sure if it's okay to add such an endorsement or not.

This could be written in a more neutral way, like "NOTE: Validating your JSON data with a JSON validator will ensure that it can be parsed correctly." or something.

@ltfschoen
Copy link
Contributor Author

@mary-poppins I have updated the commit with my primary GitHub email address visible. I have previously signed the CLA a few days ago with this same email address.

Modified contents of the proposed Note, incorporating feedback from @caitp
@jeffbcross jeffbcross force-pushed the master branch 2 times, most recently from cad9560 to f294244 Compare October 2, 2014 22:09
@jeffbcross jeffbcross force-pushed the master branch 2 times, most recently from abdaab7 to 30996f8 Compare October 8, 2014 19:47
@IgorMinar
Copy link
Contributor

cla verified

@IgorMinar IgorMinar added cla: yes and removed cla: no labels Oct 9, 2014
@IgorMinar
Copy link
Contributor

why do we need to talk about linting of json payloads at all? IMO it's not within the scope of the tutorial.

@IgorMinar
Copy link
Contributor

thanks for the PR but I don't think our tutorial is the right place for this kind of advice since the readers are not actually modifying the JSON payload.

@IgorMinar IgorMinar closed this Oct 9, 2014
@ltfschoen
Copy link
Contributor Author

@IgorMinar I agree with your comments and I don't have any issues with you closing the PR, but like I said, the main motivation behind this PR was to try and improve the experience for other new users to AngularJS, and I felt that a simple neutral note like the one suggested by @caitp (highlighting the best practice of validating their JSON data with a JSON validator) would be perceived positively as a centralised value add, allowing them to focus on further using and promoting the framework more broadly beyond just the tutorial, and without getting stuck trying to solve silly JSON parse errors along their journey.

@IgorMinar
Copy link
Contributor

there is a lot people are taking in while going through the tutorial,
that's why we need to keep it focused.

On Thu, Oct 9, 2014 at 12:54 PM, Luke Schoen notifications@github.com
wrote:

I agree with your comments and I don't have any issues with you closing
the PR, but like I said, the main motivation behind this PR was to try and
improve the experience for other new users to AngularJS, and I felt that a
simple note highlighting the best practice of validating their JSON data
with a JSON validator would be perceived as a centralised value add that
would be perceived positively, whilst advocating their use of the framework.


Reply to this email directly or view it on GitHub
#9074 (comment).

@ltfschoen
Copy link
Contributor Author

agreed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants