zoukankan      html  css  js  c++  java
  • angular service/directive

    <html class=" js cssanimations csstransitions" ng-app="phonecatApp" >
        <head>
            <title>{{title}}</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
            <link href="/scripts/service/css/font.css" rel="stylesheet" type="text/css">
            <link href="/scripts/service/css/style.css" rel="stylesheet" type="text/css" media="all">
            <link rel="stylesheet" type="text/css" href="/scripts/service/css/magnific-popup.css">
    
        </head>
    <body ng-controller="controller1">
                                <div class="cart">
                                    <a class="popup-with-zoom-anim" href ng-click="callNotify('message');">NOTIFY</a>
                                </div>
      <!--<div my-Directive></div>
        {{title}}-->
            <script type="text/javascript" src="/Scripts/angular.min.js"></script>    
            <script type="text/javascript">
                var phonecatApp = angular.module('phonecatApp', []);
    
                phonecatApp.controller('controller1', ['$scope', 'notify', function ($scope,notify) {
                    $scope.title = "Compare";
                    $scope.click1 = function () { alert('abc'); };
                    $scope.callNotify = function (msg) {
                        notify(msg);
                    };
                    $scope.phones = [
                      {
                          'name': 'Nexus S',
                          'snippet': 'Fast just got faster with Nexus S.'
                      },
                      {
                          'name': 'Motorola XOOM™ with Wi-Fi',
                          'snippet': 'The Next, Next Generation tablet.'
                      },
                      {
                          'name': 'MOTOROLA XOOM™',
                          'snippet': 'The Next, Next Generation tablet.'
                      }
                    ];
                }]);
    
                phonecatApp.directive('myDirective', function () {
                    return {
                        template: 'Name: {{phones[0].name}}'
                    };
                });
    
                phonecatApp.factory('notify', ['$window', function (win) {
                    return function (msg) {
                        console.log('function in service ' + msg);
                        return false;
                    };
                }]);
            </script>
  • 相关阅读:
    30分钟带你了解Docker
    30分钟了解Springboot整合Shiro
    vuejs 和 element 搭建的一个后台管理界面
    MySQL缓存参数优化(转)
    MVC+EF(CODEFIRST)+EASYUI医药MIS系统
    博客园开通打赏功能以及HTTPS打赏失效的探究 -玩转打赏功能
    SpringMVC集成rabbitmq:优化秒杀下单环节
    国内最火5款Java微服务开源项目
    SpringCloud系列——SSO 单点登录
    玩转spring boot
  • 原文地址:https://www.cnblogs.com/zyip/p/3895165.html
Copyright © 2011-2022 走看看