Code Monkey home page Code Monkey logo

Comments (10)

jonathan-casarrubias avatar jonathan-casarrubias commented on August 21, 2024 1

I think we just need to change that line for models/index, we are already exporting every model within the models/index.ts but I had a similar issue when using the angular-cli, that does not happen in nativescript, though.... so Ill check tomorrow morning!!!

Thanks for reporting @ottojimb

from loopback-sdk-builder.

jonathan-casarrubias avatar jonathan-casarrubias commented on August 21, 2024 1

@ottojimb I just published beta8 with the modified line, I tested and worked.. 🎯

Thanks for your patience!!!

Cheers,
Jon

from loopback-sdk-builder.

JonnyBGod avatar JonnyBGod commented on August 21, 2024

There should not be a models.service. Models are just typed interfaces not services.

from loopback-sdk-builder.

jonathan-casarrubias avatar jonathan-casarrubias commented on August 21, 2024

Agree with @JonnyBGod these are different

from loopback-sdk-builder.

jonathan-casarrubias avatar jonathan-casarrubias commented on August 21, 2024

I'm re-opening just to verify there is actually no reference for the model.service -it should not-

from loopback-sdk-builder.

JonnyBGod avatar JonnyBGod commented on August 21, 2024

@ottojimb is probably looking for some way to validate models at runtime. (connect me if I am wrong)

I believe this is out of scope for the project. But we can consider some kind of plugin system for these extensions.

from loopback-sdk-builder.

jonathan-casarrubias avatar jonathan-casarrubias commented on August 21, 2024

I'm still confused lol ... because at runtime there are no types, just plain javascript... @ottojimb can you clarify how you got to create this issue? thanks!!!

from loopback-sdk-builder.

ottojimb avatar ottojimb commented on August 21, 2024

@JonnyBGod @jonathan-casarrubias I'm generating it with the "npm run build:sdk" and my generated index.ts is as follows:

/* tslint:disable */
import { HTTP_PROVIDERS } from '@angular/http';
import { LoopBackAuth } from './services/auth.service';
import { ErrorHandler } from './services/errorHandler.service';
import { LoggerService } from './services/logger.service';
import { JSONSearchParams } from './services/search.params';
import {
  UserApi,
  AccessTokenApi,
  ...
  ReferenceApi,
  ValueApi,
  HolaApi
} from './services/api.service'
export const API_PROVIDERS: any[] = [
    HTTP_PROVIDERS,
    LoopBackAuth,
    ErrorHandler,
    LoggerService,
  JSONSearchParams,
  UserApi,
  AccessTokenApi,
  ...
  ReferenceApi,
  ValueApi,
  HolaApi
];
export * from './models'; //this line generates the issue
export * from './services/api.service';
export * from './services/config.service';
export * from './services/auth.service';
export * from './services/logger.config';
export * from './services/logger.service';

On google chrome dev tools I get:

GET http://localhost:5555/app/shared/sdk/models.js 404 (Not Found)
Error: Error: XHR error (404 Not Found) loading http://localhost:5555/app/shared/sdk/models.js(…) "Report this error at https://github.com/mgechev/angular2-seed/issues"

Then I replace the line with a new reference with the following content:

/* tslint:disable */

export * from '../models/User';
export * from '../models/AccessToken';
export * from '../models/ACL';
export * from '../models/RoleMapping';
export * from '../models/Role';
export * from '../models/ArticleType';
export * from '../models/Property';
export * from '../models/Option';
export * from '../models/OptionProperty';
export * from '../models/Country';
export * from '../models/State';
export * from '../models/City';
export * from '../models/Contact';
export * from '../models/Article';
export * from '../models/Image';
export * from '../models/Container';
export * from '../models/Group';
export * from '../models/Brand';
export * from '../models/Reference';
export * from '../models/Value';
export * from '../models/Hola';

Sorry by can't help, I'm newbie with git, the PR and typescript.

from loopback-sdk-builder.

ottojimb avatar ottojimb commented on August 21, 2024

@jonathan-casarrubias
Sorry, my VSCode hid the index file. Clearly it is the best solution.
Thank you!

from loopback-sdk-builder.

jonathan-casarrubias avatar jonathan-casarrubias commented on August 21, 2024

@ottojimb yes there is something that I ignore the reason... But when using angular cli, vcode ignores the index.ts. but only when you have like nested modules with index.ts I believe is a bug from them, we should be able to always call just the module and if there is an index it should take that.. but bleh!! anyhow I'm fixing it in our side right now, I just test it and land it in beta8.

Cheers!!
Jon

from loopback-sdk-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.