如何加载angular-bootstrap

时间:2016-04-08 16:12:56

标签: angularjs webpack angular-bootstrap oclazyload

问题:我无法从node_modules

加载'use strict'; export default require('angular') .module('lazyApp', [ require('angular-ui-router'), 'angular-bootstrap', // @TODO: It's a hack! https://github.com/ocombe/ocLazyLoad/issues/179 (() => { require('oclazyload'); return 'oc.lazyLoad' })(), //require('angular-bootstrap', /* uncomment to move msg-store to bundle.js only instead of putting it in both: 3.bundle.js and 4.bundle.js */ //require('commons/msg-store').name, require('./pages/home/home.routing').name, require('./pages/messages/messages.routing').name, //require('./pages/solr/solr.routing').name ]);
  

错误:[$ injector:nomod]模块'angular-bootstrap'不可用!   您要么错误拼写了模块名称,要么忘记加载它。如果   注册模块确保您将依赖项指定为   第二个论点。

<form method="POST" action="">
    <input type="text" name="search">
    <input type="text" name="location">
    <button type="submit" name="submit">search</button>
</form>
<?php
    require_once 'db.php';
    if(isset($_REQUEST['submit'])) {
        $search = str_replace(array('%','_'),'',$_POST['search']);
        if ($search){
            if (isset($_POST["location"])){                 
                $location= $_POST["location"];                              
                $query = "SELECT * FROM shoplist WHERE name LIKE :search OR userID LIKE :search";
                $much = $muc->prepare($query);
                $much->bindValue(':search', '%' . $search . '%', PDO::PARAM_INT);
                $much = $muc->prepare('SELECT location from shoplist WHERE      location =:location');
                $much->bindParam(':location', $location);
                $much->execute();
                if ($much->rowCount() > 0) { 
                    $result = $much->fetchAll();  
                    foreach( $result as $row ) {
                       $userID = $row['userID'];
                       $name = $row['name'];
                       $location= $row['location'];
                    }
                }
            }
        }
    }
?>

1 个答案:

答案 0 :(得分:0)

var app = angular.module('app', [
    'ui.bootstrap'

确保js脚本已加载到文件中,如果tyou使用bower,则可以使用名称

进行安装
bower install angular-bootstrap --save

然后找到该文件并将其加载到页面