<!DOCTYPE html>
<html ng-app>
<head>
<script data-require="angular.js@*" data-semver="1.4.3" src="https://code.angularjs.org/1.4.3/angular.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body ng-controller="MainController">
<h1>This is the message {{message}}</h1>
</body>
</html>
我的脚本文件有
var MainController = function($scope) {
$scope.message = "Hi this is great ";
};
但结果仍显示{{message}}而非实际消息
答案 0 :(得分:3)
这是一个有效的例子:
<body ng-app="myApp">
<div ng-controller="MainController">
Hello, {{message}}!
</div>
</body>
var myApp = angular.module('myApp',[]);
var MainController = function($scope) {
$scope.message = "Hi this is great ";
}
答案 1 :(得分:0)
HTML代码:
retrofit interface methods(i.e callbacks, headers, body )
和script.js
retrofit package
工作示例Plunker Example