angular-sails icon indicating copy to clipboard operation
angular-sails copied to clipboard

Implementing ANGULAR-SAILS in Laravel-Angular-Admin

Open redleon00 opened this issue 7 years ago • 5 comments

Hi, i have some proble when i try to implement angular-sails in my angular-laravel-admin project. I install angular-sail package with bower and in my index.module.js i have this: angular.module('app.components', [ 'ui.router', 'angular-loading-bar', 'restangular', 'ngStorage', 'satellizer', 'ui.bootstrap', 'chart.js', 'mm.acl', 'datatables', 'datatables.bootstrap', 'checklist-model', "angular-sails" ]) and in my component look like this

class EmissionPolicyListsController{ constructor($scope, $state, $log, $compile, DTOptionsBuilder, DTColumnBuilder, API, $stateParams, $uibModal, $http, ngSails){ when i run the app, show me this error message Error: [$injector:modulerr] Failed to instantiate module app.components due to: Error: [$injector:modulerr] Failed to instantiate module angular-sails due to: Error: [$injector:nomod] Module 'angular-sails' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

Can someone tell me what I'm doing wrong ? Thx

redleon00 avatar Feb 24 '18 15:02 redleon00

See the usage section of the readme, the module name is ngSails

var app = angular.module("MyApp", ['ngSails']);

TheSharpieOne avatar Feb 24 '18 16:02 TheSharpieOne

Thax @TheSharpieOne, i fix the mistake, but now the app show me this... Error: [$injector:unpr] Unknown provider: ngSailsProvider <- ngSails http://errors.angularjs.org/1.5.11/$injector/unpr?p0=ngSailsProvider%20%3C-%20ngSails

i dont know if i have to register the dependence in laravel-angular-admin framework in bower.json file... i have this.

"dependencies": { "jquery": "^2.2.3", "angular": "~1.5.x", "angular-ui-router": "~0.2.15", "ngstorage": "~0.3.10", "restangular": "~1.5.2", "angular-loading-bar": "~0.9.0", "satellizer": "^0.14.0", "angular-bootstrap": "^1.3.1", "bootstrap": "^3.3.6", "AdminLTE": "admin-lte#^2.3.3", "angular-chart.js": "^0.10.0", "angular-acl": "^0.1.5", "angular-datatables": "^0.5.4", "sweetalert": "^1.1.3", "checklist-model": "^0.9.0", "angular-select2": "^1.5.2", "angular-sails": "1.1.4" },

did you see some mistake?

redleon00 avatar Feb 24 '18 22:02 redleon00

It's $sails not ngSails

TheSharpieOne avatar Feb 24 '18 22:02 TheSharpieOne

Dont worry...i solve the mistake...in component controller the provider like this constructor($scope, $state, $log, $compile, DTOptionsBuilder, DTColumnBuilder, API, $stateParams, $uibModal, $http, $sails){ 'ngInject';

Call the provider $sails.

redleon00 avatar Feb 24 '18 22:02 redleon00

yes...you rigth men...thax u!!!

redleon00 avatar Feb 24 '18 22:02 redleon00