Skip to content

Commit 41a1ef3

Browse files
committed
objectpath with browserify, ObjectPath without
1 parent 496cd3b commit 41a1ef3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/sfPath.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
angular.module('schemaForm').provider('sfPath',
22
[function() {
3-
var sfPath = {parse: objectpath.parse};
3+
4+
// When building with browserify it's objectpath,
5+
// otherwise it's just objectpath.
6+
var ObjectPath = window.ObjectPath || objectpath;
7+
8+
var sfPath = {parse: ObjectPath.parse};
49

510
// if we're on Angular 1.2.x, we need to continue using dot notation
611
if (angular.version.major === 1 && angular.version.minor < 3) {
712
sfPath.stringify = function(arr) {
813
return Array.isArray(arr) ? arr.join('.') : arr.toString();
914
};
1015
} else {
11-
sfPath.stringify = objectpath.stringify;
16+
sfPath.stringify = ObjectPath.stringify;
1217
}
1318

1419
// We want this to use whichever stringify method is defined above,

0 commit comments

Comments
 (0)