Dmitry  Skryabin
Dmitry Skryabin

Reputation: 1636

How to run AngularJS on JSFiddle?

I have a trouble with starting an example in JSFiddle, it's simple code with AngularJS module, but I get a error with injecting module.

Javascript code:

angular
  .module('App', ['ngMaterial'])
  .controller('Ctrl', function($scope) {
    $scope.text = 'Hello';
  });

Html code:

<div ng-app="App" ng-controller="Ctrl">
  {{ text }}
</div>

Please, help me to fix it. Link to my JSFiddle

Upvotes: 1

Views: 705

Answers (1)

deChristo
deChristo

Reputation: 1878

You need to change you javascript Load Type configuration. For example:

No wrap - in <body> or <head>

enter image description here

Updated JSFiddle

Upvotes: 2

Related Questions