我是angularjs的初学者,目前我正面临着ng-include的问题.
我有一个使用partials的测试应用程序.这是我的代码.
<html ng-app ="TextboxExample">
<head>
<title>Settings</title>
<script src="angular.js"></script>
</head>
<body ng-controller="ExampleController">
<div ng-include src = "'view.html'"></div>
<script>
angular.module('TextboxExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.textboxVal = 'fddfd';
$scope.ReadGeneralSettings = function() {
alert($scope.textboxVal);
}
$scope.ResetGeneralSettings = function() {
$scope.textboxVal = 'fddfd';
}
}]);
</script>
<button class="pull-right" ng-click = "ReadGeneralSettings()">Read</button>
<button class="pull-right" ng-click = "ResetGeneralSettings()">Cancel</button>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
部分代码view.html是
<input type="text" ng-model="textboxVal">
Run Code Online (Sandbox Code Playgroud)
出于某种原因,当我在文本框中输入值时,设置为ng-model的textboxVal不会更新.但是如果我不使用ng-include并直接将view.html的内容添加到主html文件中,这样可以正常工作.请帮忙.
谢谢Sunil
我有一个vs项目,一旦升级到visual studio 2012就无法编译.它是一个win32 dll项目,它抱怨def文件.这是def文件,
LIBRARY test.dll
VERSION 3.1.4.1
EXPORTS
addNumbers @1
Run Code Online (Sandbox Code Playgroud)
这是我在visual studio 2012 ultimate中编译项目时遇到的错误.
Source.def(2): fatal error LNK1118: syntax error in 'VERSION' statement
Run Code Online (Sandbox Code Playgroud)
让我感到困惑的是,这与视觉工作室2008和2010完美搭配.
知道这里出了什么问题吗?
谢谢Sunil