Error http://errors.angularjs.org/1.6.5/$injector" in laravel with angular js -


haii friends, need have problem not know, when try combine laravel , angular js, can guys me.

"error: [$injector:modulerr] http://errors.angularjs.org/1.6.5/$injector"

for more details created file index.php , code :

<!doctype html> <html ng-app="sample" lang="{{ config('app.locale') }}"> <head>     <meta charset="utf-8">     <meta http-equiv="x-ua-compatible" content="ie=edge">     <meta name="viewport" content="width=device-width, initial-scale=1">      <title>starter - laravel & angularjs</title>      <!-- fonts -->     <link href="https://fonts.googleapis.com/css?family=raleway:100,600" rel="stylesheet" type="text/css">          <title>rainbow sdk web</title>         <meta charset="utf-8">         <meta http-equiv="x-ua-compatible" content="ie=edge">         <meta name="viewport" content="width=device-width, initial-scale=1">         <link rel="shortcut icon" type="image/png" href="./res/applogo.png"/>         <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=open+sans:400,300,600&subset=latin,cyrillic-ext,cyrillic">        <!--  <link rel="stylesheet" href="./resources/angular/js/components/connection/connectioncmp.css"> -->         <script src="{{ asset('resources/build/js/components.js') }}"></script>        <!--  <script src="./resources/angular/js/components/connection/connectioncmp.js"></script> --> </head>     <body>       <!-- demo specific part -->  <div class="flex-center position-ref full-height" ng-controller="samplecontroller">         <div class="content">         <div class="view page page-home" ng-view></div>     </div> </div>  <!-- angular init here -->  <script src="//api.openrainbow.com/sdk/web/libs/loader-sdk.min.js" data-main="./config.json"></script>  <!-- app js files - controllers --> <script src="{{ asset('resources/angular/js/application.js') }}"></script> <script src="{{ asset('resources/angular/js/maincontroller.js') }}"></script>  </body> </html> 

and application.js file route

var sample = angular.module('sample', ['ngroute', 'nganimate']);  sample.config(function ($routeprovider, $httpprovider) {     $routeprovider.when('/dashboard', {         controller: 'samplecontroller',         templateurl: '../partials/dashboard.html'     })       $routeprovider.otherwise({         redirectto: '/dashboard',         templateurl: 'resources/angular/partials/dashboard.html'     }) }); 

and maincontroller.js file controller

var sample = angular.module("sample", ["sdk"]);  sample.controller("samplecontroller", [     "$rootscope",     "rainbowsdk",      function($rootscope, sdk) {         "use strict";          console.log("[demo] :: rainbow im application");          var onready = function onready() {             console.log("[demo] :: rainbow sdk ready!");         };          var onloaded = function onloaded() {             console.log("[demo] :: rainbow sdk has been loaded!");              sdk.initialize().then(function() {                 console.log("[demo] :: rainbow sdk initialized!");             }).catch(function() {                 console.log("[demo] :: went wrong sdk...");             });         };          $rootscope.$on(sdk.rainbow_onready, onready);          $rootscope.$on(sdk.rainbow_onloaded, onloaded);          sdk.useangularevents(true);         sdk.load();          return true;     } ]); 

i hope friends can me,thanks.

you need move dependency injection main module , remove controller,

application.js

var sample = angular.module('sample', ['ngroute', 'nganimate','sdk']); 

maincontroller.js

var sample = angular.module("sample"); 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -