如题。。
dict.js:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 'use strict' ; angular.module( 'app' ).value( 'dict' , {}).run([ '$http' , function ($http){ $http.get( 'data/city.json' , {}) .then( function (resp){ dict.city = resp.data; }). catch () $http.get( 'data/salary.json' , {}) .then( function (resp){ dict.salary = resp.data; }). catch () $http.get( 'data/scale.json' , {}) .then( function (resp){ dict.scale = resp.data; }). catch () }]) |