Skip to content

Small fixes and make it work with webpack#2

Open
yktoo wants to merge 2 commits intocornflourblue:masterfrom
yktoo:master
Open

Small fixes and make it work with webpack#2
yktoo wants to merge 2 commits intocornflourblue:masterfrom
yktoo:master

Conversation

@yktoo
Copy link
Copy Markdown

@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) {
Copy link
Copy Markdown

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
Copy Markdown
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?

Copy link
Copy Markdown

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
Copy Markdown
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.

Copy link
Copy Markdown

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
Copy Markdown
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?

Copy link
Copy Markdown

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