简体   繁体   中英

AngularJS : asp.net MVC View as Dashboard Widget

New to Angular.js, We have a asp.net MVC 4 View that uses Angular. It can directly be accessed from localHost/Controller/View URL. The view works fine but I am working on adding a new dashboard. For the dashboard I have created a (brand new) partial page in MVC.

And now, I am trying to display the same page appear on dashboard within a div by using (Razor) :

@{Html.RenderAction("Index", "CustomerController");} 

but I'm getting an error that reads :

Error: [ng:areq] Argument 'CustomerNgController' is not a function, got undefined

I did make sure that I am adding a reference to Angular & the .js file that contains the controller above. Still can not figureout the cause for the error.

@Ablaze - If you could post some code I'd be glad to look at it. Generally it just means that it can't find it because it hasn't been created yet. Maybe the order of your scripts might be the issue. And make sure the module knows about it too like:

angular.module('myApp').controller('CustomerNgController', function($scope) {
   ...
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM