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>
  • 相关阅读:
    python基础知识第三篇(列表)
    python基础知识第二篇(字符串)
    python基础知识第一篇(认识Python)
    tomacat环境搭建
    Python的内存管理机制
    selenium定位方法
    python+selenium xpath定位
    django--创建及配置项目app
    django--cookies和session
    django--orm--012
  • 原文地址:https://www.cnblogs.com/zyip/p/3895165.html
Copyright © 2011-2022 走看看