JavaScript Angular ES6 - $inject is not a function angular inject function,angular inject function into component,angularjs inject

I just started to learn Angular ES6 way. I am analyzing this example from github: https://github.com/sitepoint-editors/Angular-ES6-BookShelf/blob/master/app/Controllers/HomeController.js

And I tried by myselfe:

class ModalCtrl {
    constructor($scope, $rootScope, app) {
        $rootScope.$on('openModal', (event, data) => {
            $scope.data = data;
            $scope.modalClass = 'open';
        });
    }
}

ModalCtrl.$inject(['$scope', '$rootScope', 'app']);

export default ModalCtrl;

But I get app.min.js:60 Uncaught TypeError: ModalCtrl.$inject is not a function What I am doing wrong and how to make this proper way?

Answer:1

I'm trying to send a http request to a website and I need the user to fill out their names and mobile number. I'm trying to do it as followed (I'm still working on the validate function so right now ...

I'm trying to send a http request to a website and I need the user to fill out their names and mobile number. I'm trying to do it as followed (I'm still working on the validate function so right now ...

  1. html input values
  2. html input values array
  3. html input value code
  4. html input multiple values
  5. html input autocomplete values
  6. html input multiple values array
  7. html calculate input values
  8. html input type values
  9. html input 2 values
  10. html input two values
  11. html sum input values
  12. html input checkbox values
  13. html input default values
  14. html input predefined values
  15. html form input values
  16. html input keep values
  17. read html input values c#
  18. html input range values
  19. html input limit values
  20. html multiply input values

I have a few divs that share the same class. I have a dropdown that changes the background color of one of those divs when selected(option 2 changes div #2). My question is how can I change the ...

I have a few divs that share the same class. I have a dropdown that changes the background color of one of those divs when selected(option 2 changes div #2). My question is how can I change the ...

  1. find which element has focus
  2. find which element is scrolling
  3. find which element is clicked jquery
  4. find which element python
  5. find out which element you are
  6. jquery find which element is focused
  7. jquery find which element is visible
  8. find element in list python
  9. find_element_by_xpath
  10. find element in array javascript
  11. find element in vector c++
  12. find_element_by_css_selector
  13. find_element_by_class_name
  14. find element by xpath selenium python
  15. find element by class
  16. find element in array python
  17. find_element_by_id
  18. find_element_by_link_text
  19. find element jquery
  20. find element by class selenium

I am currently creating a webpage using HTML/CSS and jQuery/Basic JS. I'm using a jQuery code to show a GIF image while the website is loading $(window).load(function() { $(".loading").fadeOut(...

I am currently creating a webpage using HTML/CSS and jQuery/Basic JS. I'm using a jQuery code to show a GIF image while the website is loading $(window).load(function() { $(".loading").fadeOut(...

  1. website loading page design
  2. website loading page
  3. website page loading speed test
  4. website page loading speed
  5. website page loading animation
  6. website page loading time
  7. website page loading test
  8. website page loading slow
  9. website loading blank page
  10. create website loading page
  11. website stuck loading page
  12. website not loading blank page

I have a basic bootstrap modal to log in, which doesn't close itself when I hit submit. I solved it using this simple jquery: $('#myModal').modal('hide'); But I also want the modal to fade out ...

I have a basic bootstrap modal to log in, which doesn't close itself when I hit submit. I solved it using this simple jquery: $('#myModal').modal('hide'); But I also want the modal to fade out ...

  1. hide bootstrap modal jquery
  2. hide bootstrap modal using javascript
  3. hide bootstrap modal after 3 seconds
  4. hide bootstrap modal on page load
  5. hide bootstrap modal angular
  6. hide bootstrap modal on button click
  7. hide bootstrap modal using jquery
  8. hide bootstrap modal popup using jquery
  9. hide bootstrap modal
  10. hide bootstrap modal on ajax success
  11. hide bootstrap modal on click
  12. hide bootstrap modal backdrop
  13. hide bootstrap modal js
  14. hide bootstrap modal in angular 4
  15. hide bootstrap modal from code behind c#
  16. hide bootstrap modal after submit
  17. hide bootstrap modal react
  18. hide bootstrap modal in c#
  19. hide bootstrap modal event
  20. hide bootstrap modal angularjs