Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Problem importing Angular module from different file

$
0
0

@iad wrote:

Hi guys!

I experience a problem with importin angular module (into app.js) from a different file. A brief example:

js/app.js:

// if uncomment the next line, app works
// angular.module('API', []);

var app = angular.module('ionicApp', ['ionic', 'API']);

lib/API.js:

var app = angular.module('API', []);
app.config({});

index.html

blah blah
  <script src="lib/API.js"></script>
  <script src="js/app.js"></script>
</head>

<body>
  <ion-nav-view name="basicForm"></ion-nav-view>
</body>

So if i try to import an Angular module from the other file, the app just does not render anything. Whilst imported module from the same file works well.

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>