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

Clean global scope in all controllers. #980

Open
NitayRabi opened this issue Nov 29, 2018 · 1 comment
Open

Clean global scope in all controllers. #980

NitayRabi opened this issue Nov 29, 2018 · 1 comment

Comments

@NitayRabi
Copy link
Contributor

NitayRabi commented Nov 29, 2018

Overview of the problem

We have several functions declared globally in controller files.
This can create issues hard to anticipate and solve.

Description

  1. We need to move all functions into scope.
    image
    image
  2. We need to make sure the functions aren't used in any other file (if so, we should create an AngularJS service to be shared between the controllers)
  3. Sanity after the cleanup - check most screens and buttons don't raise exceptions related to missing functions.

Expected behavior

Functions should be scoped

Actual behavior

Functions are declared outside of AngularJS's controllers call back

@galnitsan
Copy link
Member

function moved inside controllers.
suitable names were named for these functions.
the "old" names of functions were changed to the "new" names in all functions calls.
2 new services were create (factory) - (camps/suppliers).
camps/suppliers services were injected to relevant controllers.
camps/suppliers services were declared in layout.jade (under "spark scripts").

still 1 issue in suppliers edit page.

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

No branches or pull requests

2 participants