fix(angular.toJson): only strip properties beginning with $$, not $

BREAKING CHANGE:

If you expected `toJson` to strip these types of properties before,
you will have to manually do this yourself now.
This commit is contained in:
rodyhaddad
2014-02-15 01:04:40 -05:00
committed by Brian Ford
parent 8c02a49bb4
commit c054288c97
2 changed files with 9 additions and 4 deletions

View File

@@ -1131,8 +1131,13 @@ describe('angular', function() {
});
it('should not serialize properties starting with $', function() {
expect(toJson({$few: 'v', $$some:'value'}, false)).toEqual('{}');
it('should not serialize properties starting with $$', function() {
expect(toJson({$$some:'value'}, false)).toEqual('{}');
});
it('should serialize properties starting with $', function() {
expect(toJson({$few: 'v'}, false)).toEqual('{"$few":"v"}');
});