Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes and make it work with webpack #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Small fixes and make it work with webpack #2

wants to merge 2 commits into from

Conversation

yktoo
Copy link

@yktoo yktoo commented Feb 12, 2017

Hi Jason, thanks for the great tutorial! I fixed a couple of small things in HTML templates, and also refactored fake-backed to make it work with webpack, too (webpack is used by default in recent versions of angular-cli, and it won't support lambda for factory).

// else return 400 bad request
connection.mockError(new Error('Username or password is incorrect'));
}
function fakeBackendFactory(backend: MockBackend, options: BaseRequestOptions, realBackend: XHRBackend) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still I can see the error

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it in Plunker, there was no error. What error do you get?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR in Error encountered resolving symbol values statically. Reference to a non-exported function (position 4:10 in the original .ts file), resolving symbol fakeBackendProvider in ...

Copy link
Author

@yktoo yktoo Feb 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, perhaps this function needs to be exported too (works for me with webpack as it is). Anyway, the first commit is safe to merge, the second one may be a bit controversial.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply it should be export function fakeBackendFactory()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Shall I add commit this one?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the change and it seems good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants