使用JQuery和AngularJS设置文本 [英] Set text using JQuery and AngularJS

查看:62
本文介绍了使用JQuery和AngularJS设置文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对AngularJS来说是全新的。需要帮助才能使以下代码有效:



Am completely new to AngularJS. Need help to make the following code work:

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Employee Profile</title>
    <script src="Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script type='text/javascript' src="http://code.angularjs.org/1.0.1/angular-1.0.1.min.js"></script>

    <script type="text/javascript">

        var myApp = angular.module("myApp", []);

        $(document).ready(function () {
            myApp.controller("EmpCtrl", ['$scope', function ($scope) {
                $scope.FirstName = "Angular";
                $scope.LastName = "JS";
            } ]);
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div ng-app="myApp" ng-controller="EmpCtrl">
            {{ FirstName }}
            <br />
            {{ LastName }}
    </div>
    </form>
</body>
</html>

推荐答案

document )。ready( function (){
myApp.controller( EmpCtrl,[ '
(document).ready(function () { myApp.controller("EmpCtrl", ['


scope', function


scope){


这篇关于使用JQuery和AngularJS设置文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆