我有这个名为backendUrls.ts的打字稿文件:
// root url
export const rooturl = 'http://127.0.0.1:8000/api';
//get a list of all cities
export const cityListUrl = rooturl + '/city-list';
// get all form choice perams
export const venueFilterOptionsUrl = rooturl + '/venue-filter-options-list/'; /** plus a user entered city*/
export const neighborhoodGetUrl = rooturl +'neighborhood-list';
这是一个非常酷的文件
我正在尝试将其导入此文件:
import {Injectable} from '@angular/core';
import{Http, Response} from '@angular/http';
import 'rxjs/Rx';
import {venueFilterOptionsUrl, neighborhoodGetUrl} from './services/backendUrls';
@Injectable()
export class DynamicFormDataService{......
它也是一个非常酷的文件
他们在这个结构中
`app
services
backendurls.ts
dynamicFormDataService.ts`
万一你错过了我试图导入backendUrls.ts
文件,如下所示:
import {venueFilterOptionsUrl, neighborhoodGetUrl} from './services/backendUrls';
但兄弟我告诉你它不会发生,并且它让我疯狂,因为我做错了,我觉得我很喜欢非常酷docs很好
闷闷不乐的男人