Home How to pass RAZOR @ViewBag.Message to AngularJS $scope variable ?
Reply: 0

How to pass RAZOR @ViewBag.Message to AngularJS $scope variable ?

Jacek
1#
Jacek Published in 2017-12-06 12:39:15Z

For some reason I need to use RAZOR mixed with angularJS. Have @ViewBag.Message I wish to sand back to the controller. How can I make it.

I tried this;

 <h2 ng-init="name = @ViewBag.Message"> {{name}}>

//

  angular.module('app.Contact', [])
  .controller('ContactCtrl', function ($scope, $http, $location, $routeParams) {

    //$scope.name = $routeParams.pQrIdentifier;

    $scope.name = ''


});
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.296057 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO